diff options
Diffstat (limited to 'js/codeq')
-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){ |