summaryrefslogtreecommitdiff
path: root/js
diff options
context:
space:
mode:
Diffstat (limited to 'js')
-rw-r--r--js/codeq/login.js15
-rw-r--r--js/codeq/navigation.js5
2 files changed, 14 insertions, 6 deletions
diff --git a/js/codeq/login.js b/js/codeq/login.js
index 114381c..a33eb20 100644
--- a/js/codeq/login.js
+++ b/js/codeq/login.js
@@ -48,6 +48,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) {
@@ -55,16 +56,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){