summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Zorko <robertz@gurucue.com>2015-10-13 17:03:33 +0200
committerRobert Zorko <robertz@gurucue.com>2015-10-13 17:03:33 +0200
commit9f5bcf0217be9400b2ee012577c4d5a44a44c3cc (patch)
tree2423c234affe9acff841918ff160678bf382007d
parente0db123e858bbac40acd66aa43f77b0c2d98a039 (diff)
disabled using the browser navigation button to jump back to a screen after logout and fixed a small display error where the banner would say 'signed in' twice
-rw-r--r--js/codeq/comms.js3
-rw-r--r--js/codeq/login.js2
-rw-r--r--js/codeq/navigation.js6
3 files changed, 10 insertions, 1 deletions
diff --git a/js/codeq/comms.js b/js/codeq/comms.js
index 1022f73..e12ffa3 100644
--- a/js/codeq/comms.js
+++ b/js/codeq/comms.js
@@ -267,6 +267,9 @@
// ================================================================================
codeq.comms = {
+ 'getSid':function(){
+ return sid;
+ },
'connect': function () {
var deferred = Q.defer();
diff --git a/js/codeq/login.js b/js/codeq/login.js
index 62d15b4..a3158ae 100644
--- a/js/codeq/login.js
+++ b/js/codeq/login.js
@@ -66,7 +66,7 @@
formInputs.off('keyup');
//$('#modalLogIn').modal('hide');
$("#screen_login").css('display', 'none');
- $('#signed-in-title').html('Signed in as '+$('#username').val());
+ $('#signed-in-title').html($('#username').val());
$("#password").val('');
//re-enable the click listener
$('#navigation-home').on('click', function(e){
diff --git a/js/codeq/navigation.js b/js/codeq/navigation.js
index af1d250..57b398d 100644
--- a/js/codeq/navigation.js
+++ b/js/codeq/navigation.js
@@ -70,6 +70,12 @@
def[name] = state;
},
'actualTransition': function (name) {
+ //check if we are logged in - if we aren't we will always transition to the login state
+ if(!codeq.comms.getSid()){
+ name = 'login';//this will cause the following code to transition to the login state instead of the original one given
+ }
+
+
var newState = def[name];//if the newState is not the same as the old or if it doesn't exist at all is already checked at this point
if (currState) currState.exit();
currState = newState;