From cfff8b498f31f57fc27a8d380c5a6febcd15edda Mon Sep 17 00:00:00 2001 From: peteruithoven Date: Mon, 28 Oct 2013 11:16:00 +0100 Subject: [PATCH] Open Settings window after settings are loaded --- js_src/SettingsWindow.js | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/js_src/SettingsWindow.js b/js_src/SettingsWindow.js index de546fb..a605767 100644 --- a/js_src/SettingsWindow.js +++ b/js_src/SettingsWindow.js @@ -151,12 +151,10 @@ function SettingsWindow() { } this.showSettings = function() { - console.log("f:showSettings()"); - - this.loadSettings(); // reload settings -// this.window.css("display","table"); - $("#contentOverlay").fadeIn(375, function() { - document.body.removeEventListener('touchmove',prevent,false); + this.loadSettings(function() { // reload settings + $("#contentOverlay").fadeIn(375, function() { + document.body.removeEventListener('touchmove',prevent,false); + }); }); } this.hideSettings = function(complete) { @@ -167,7 +165,7 @@ function SettingsWindow() { }); } - this.loadSettings = function() { + this.loadSettings = function(complete) { if (!communicateWithWifibox) { console.log(" communicateWithWifibox is false: settings aren't being loaded from wifibox...") return; @@ -184,6 +182,7 @@ function SettingsWindow() { console.log(" settings: ",settings); self.fillForm(); $(document).trigger(SettingsWindow.SETTINGS_LOADED); + if(complete) complete(); } }).fail(function() { console.log("Settings:loadSettings: failed");