diff options
| author | manzerbredes <loic.guegan_secondary@yahoo.fr> | 2016-02-03 16:59:04 +0100 |
|---|---|---|
| committer | manzerbredes <loic.guegan_secondary@yahoo.fr> | 2016-02-03 16:59:04 +0100 |
| commit | 07fbfa6ad1859e16f9f957c4a26d87b11fa089a5 (patch) | |
| tree | e80cefac3645758ee5d77989ad736763c2751954 | |
| parent | eb9f9c9a6e410b8feaf0f628dcbb35ceafea83e5 (diff) | |
Add login controller, loading after click on login button and some stuff...
| -rw-r--r-- | client/index.html | 1 | ||||
| -rw-r--r-- | client/js/controllers/home.js | 3 | ||||
| -rw-r--r-- | client/js/controllers/login.js | 32 | ||||
| -rw-r--r-- | client/partials/home.html | 3 | ||||
| -rw-r--r-- | client/partials/login.html | 7 | ||||
| -rw-r--r-- | client/partials/network.html | 1 |
6 files changed, 39 insertions, 8 deletions
diff --git a/client/index.html b/client/index.html index 4ce693b..018def2 100644 --- a/client/index.html +++ b/client/index.html @@ -75,6 +75,7 @@ <!-- Include controller --> <script src="./js/controllers/home.js"></script> + <script src="./js/controllers/login.js"></script> <script src="./js/controllers/network.js"></script> <script src="./js/controllers/status.js"></script> diff --git a/client/js/controllers/home.js b/client/js/controllers/home.js index 4a9fb21..2898de2 100644 --- a/client/js/controllers/home.js +++ b/client/js/controllers/home.js @@ -7,6 +7,5 @@ mainApp.controller('homeCtrl', function ($scope) { - // Login before use App - //$('#loginModal').modal({backdrop: 'static', keyboard: false}); + });
\ No newline at end of file diff --git a/client/js/controllers/login.js b/client/js/controllers/login.js new file mode 100644 index 0000000..4cd4bf4 --- /dev/null +++ b/client/js/controllers/login.js @@ -0,0 +1,32 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ + + +mainApp.controller('loginCtrl', function ($scope,$interval,$sce) +{ + // Define default states + $('#loginModal').modal({backdrop: 'static', keyboard: false}); + $('#loadingLoginButton').hide(); + + + + $('#loginButton').click(function(){ + $('#loginButton').hide(); + $('#loadingLoginButton').show(); + + + + $interval( + function() + { + $('#loginButton').show(); + $('#loadingLoginButton').hide(); + }, 2000,1); + + + + }); +}) diff --git a/client/partials/home.html b/client/partials/home.html index 3882ada..7a5045a 100644 --- a/client/partials/home.html +++ b/client/partials/home.html @@ -1,9 +1,8 @@ <div class="panel panel-default"> <div class="panel-heading"> - Home + Home </div> <div class="panel-body"> Main Content </div> -</div> </div>
\ No newline at end of file diff --git a/client/partials/login.html b/client/partials/login.html index 6f08f76..d9b7fee 100644 --- a/client/partials/login.html +++ b/client/partials/login.html @@ -1,4 +1,4 @@ -<div class="modal fade" id="loginModal"> +<div class="modal fade" id="loginModal" ng-controller="loginCtrl"> <div class="modal-dialog"> <div class="modal-content"></div> </div> @@ -32,8 +32,9 @@ </div> <div class="modal-footer"> <!--<a href="#" data-dismiss="modal" class="btn btn-default">Close</a>--> - - <a href="#" class="btn btn-primary btn-block" ng-click="processForm()">Login</a> + <button class="btn btn-lg btn-warning btn-block" id="loadingLoginButton"><span class="glyphicon glyphicon-refresh glyphicon-refresh-animate"></span> Loading...</button> + + <a href="#" class="btn btn-lg btn-primary btn-block" id="loginButton" ng-click="processForm()">Login</a> </div> </div> </div> diff --git a/client/partials/network.html b/client/partials/network.html index 341f1a0..8b779be 100644 --- a/client/partials/network.html +++ b/client/partials/network.html @@ -6,4 +6,3 @@ Main Content </div> </div> -</div> |
