Moved settings load and shortcuts init around.
This commit is contained in:
parent
20cef8fc34
commit
efca30743a
|
|
@ -5,6 +5,9 @@
|
||||||
function Shortcuts() {}
|
function Shortcuts() {}
|
||||||
|
|
||||||
Shortcuts.init = function(target) {
|
Shortcuts.init = function(target) {
|
||||||
|
// Do not initialize twice
|
||||||
|
if (this.overlay) return;
|
||||||
|
|
||||||
var that = this;
|
var that = this;
|
||||||
target.addEventListener('keydown', function(e) { that.handleKey(e); });
|
target.addEventListener('keydown', function(e) { that.handleKey(e); });
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -978,13 +978,10 @@ function on_ws_recv(evt) {
|
||||||
Utils.setVesselUrl(config['vessel_url']);
|
Utils.setVesselUrl(config['vessel_url']);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Load user interface settings
|
// Load user interface settings from local storage
|
||||||
UI.loadSettings();
|
UI.loadSettings();
|
||||||
Chat.loadSettings();
|
Chat.loadSettings();
|
||||||
|
|
||||||
// Initialize keyboard shortcuts
|
|
||||||
Shortcuts.init(document.body);
|
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case "secondary_config":
|
case "secondary_config":
|
||||||
var s = json['value'];
|
var s = json['value'];
|
||||||
|
|
@ -1217,6 +1214,9 @@ function onAudioStart(apiType){
|
||||||
|
|
||||||
// Load audio settings from local storage
|
// Load audio settings from local storage
|
||||||
UI.loadAudioSettings();
|
UI.loadAudioSettings();
|
||||||
|
|
||||||
|
// Initialize keyboard shortcuts
|
||||||
|
Shortcuts.init(document.body);
|
||||||
}
|
}
|
||||||
|
|
||||||
var reconnect_timeout = false;
|
var reconnect_timeout = false;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue