diff options
author | Robert Zorko <robertz@gurucue.com> | 2015-10-13 15:27:01 +0200 |
---|---|---|
committer | Robert Zorko <robertz@gurucue.com> | 2015-10-13 15:27:01 +0200 |
commit | 0977874bac2a1ec5a7fee0c276b1da74ce2e1c90 (patch) | |
tree | f696e01a87fa6e0833d613709b09a3ecbe4fc19e /js | |
parent | d82ad6356586e74f41869647d57157993a3d6161 (diff) |
moved login from a popup to its own page and made some changes to the logout button
Diffstat (limited to 'js')
-rw-r--r-- | js/codeq/login.js | 15 | ||||
-rw-r--r-- | js/codeq/navigation.js | 5 |
2 files changed, 14 insertions, 6 deletions
diff --git a/js/codeq/login.js b/js/codeq/login.js index d127fe3..902f1b8 100644 --- a/js/codeq/login.js +++ b/js/codeq/login.js @@ -47,6 +47,7 @@ codeq.globalStateMachine.register('login',{ 'enter': function(){ + $('#navigation-home').off('click');//remove the click listener of this element here only - in each other state the listener should exist $('#signed-in-title').html(''); $("#submit").on('click', loginFun); formInputs.on('keyup', function (ev) { @@ -54,16 +55,22 @@ $('#submit').trigger('click'); } }); - $('#modalLogIn').modal(); - //$("#screen_login").css('display', ''); + //$('#modalLogIn').modal(); + $("#screen_login").css('display', ''); $('#disabled').css('display', 'none'); }, 'exit' : function(){ $("#submit").off('click', loginFun); formInputs.off('keyup'); - $('#modalLogIn').modal('hide'); - //$("#screen_login").css('display', 'none'); + //$('#modalLogIn').modal('hide'); + $("#screen_login").css('display', 'none'); + $('#signed-in-title').html('Signed in as '+$('#username').val()); $("#password").val(''); + //re-enable the click listener + $('#navigation-home').on('click', function(e){ + codeq.globalStateMachine.transition('language'); + e.preventDefault(); + }); } }); })(); diff --git a/js/codeq/navigation.js b/js/codeq/navigation.js index eafa5cc..af1d250 100644 --- a/js/codeq/navigation.js +++ b/js/codeq/navigation.js @@ -105,14 +105,15 @@ codeq.comms.logout() .then(function (data) { console.log(data); - //codeq.globalStateMachine.transition('login'); + codeq.comms.disconnect(); + codeq.globalStateMachine.transition('login'); }) .fail(function (reason) { console.log(reason); }) .done(); - codeq.globalStateMachine.transition('login'); + //codeq.globalStateMachine.transition('login'); e.preventDefault();//prevent this since we'll trigger a page reload otherwise }); $('#navigation-profile').on('click', function(e){ |