diff options
author | Robert Zorko <robertz@gurucue.com> | 2015-09-29 15:29:42 +0200 |
---|---|---|
committer | Robert Zorko <robertz@gurucue.com> | 2015-09-29 15:29:42 +0200 |
commit | a565a09172071783174450cea5a425964f3b6aa6 (patch) | |
tree | 2a05a549c64b9a84e5f7bb98b04f8ca616807d26 /js/codeq | |
parent | 1e0c68482267f7e7393d2cde5042fcd863b8e23b (diff) |
added settings to the global codeq object and they are updated when the user logs into the application
Diffstat (limited to 'js/codeq')
-rw-r--r-- | js/codeq/core.js | 2 | ||||
-rw-r--r-- | js/codeq/login.js | 8 |
2 files changed, 10 insertions, 0 deletions
diff --git a/js/codeq/core.js b/js/codeq/core.js index 1685dd7..ef3648f 100644 --- a/js/codeq/core.js +++ b/js/codeq/core.js @@ -199,6 +199,8 @@ 'log': log, + 'settings':{}, + 'availableLangs': [], // filled at boot from 'supportedLangs' 'supportedLangs': { 'en': 'English', diff --git a/js/codeq/login.js b/js/codeq/login.js index bb92325..02a6517 100644 --- a/js/codeq/login.js +++ b/js/codeq/login.js @@ -14,6 +14,14 @@ $('#disabled').css('display', 'none'); $('#disabled').css('cursor', ''); if (data.code !== 0) throw new Error('Login failed, code: ' + data.code + ', message: ' + data.message); + + //merge these settings into the already existing default settings + sett = data.settings; + $.merge(true, codeq.settings, sett); + if('lang' in sett && sett['lan'] in codeq.supportedLangs){ + codeq.setLang(sett['lan']); + } + codeq.globalStateMachine.transition('language'); //codeq.activateState('language'); }) |