mirror of
https://github.com/Doodle3D/doodle3d-client.git
synced 2024-11-24 18:17:56 +01:00
Disabling SettingsWindow ok button while saving
This commit is contained in:
parent
341fb637b8
commit
8550cc586a
@ -35,6 +35,7 @@ function SettingsWindow() {
|
|||||||
this.wifiboxURL;
|
this.wifiboxURL;
|
||||||
this.wifiboxCGIBinURL
|
this.wifiboxCGIBinURL
|
||||||
this.window;
|
this.window;
|
||||||
|
this.btnOK;
|
||||||
this.form;
|
this.form;
|
||||||
this.timeoutTime = 3000;
|
this.timeoutTime = 3000;
|
||||||
this.retryDelay = 2000; // retry setTimout delay
|
this.retryDelay = 2000; // retry setTimout delay
|
||||||
@ -97,8 +98,10 @@ function SettingsWindow() {
|
|||||||
this.wifiboxCGIBinURL = wifiboxCGIBinURL;
|
this.wifiboxCGIBinURL = wifiboxCGIBinURL;
|
||||||
|
|
||||||
this.window = $("#settings");
|
this.window = $("#settings");
|
||||||
this.window.find(".btnOK").click(this.submitwindow);
|
this.btnOK = this.window.find(".btnOK");
|
||||||
this.window.find(".settingsContainer").load("settings.html", function() {
|
enableButton(this.btnOK,this.submitwindow);
|
||||||
|
|
||||||
|
this.window.find(".settingsContainer").load("settings.html", function() {
|
||||||
console.log("Settings:finished loading settings.html, now loading settings...");
|
console.log("Settings:finished loading settings.html, now loading settings...");
|
||||||
|
|
||||||
self.form = self.window.find("form");
|
self.form = self.window.find("form");
|
||||||
@ -128,10 +131,13 @@ function SettingsWindow() {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
this.submitwindow = function(e) {
|
this.submitwindow = function(e) {
|
||||||
|
disableButton(self.btnOK,self.submitwindow);
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
self.saveSettings(self.readForm(),function(){
|
self.saveSettings(self.readForm(),function(){
|
||||||
self.hideSettings();
|
self.hideSettings(function() {
|
||||||
|
enableButton(self.btnOK,self.submitwindow);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
clearTimeout(self.retryRetrieveNetworkStatusDelay);
|
clearTimeout(self.retryRetrieveNetworkStatusDelay);
|
||||||
@ -146,10 +152,11 @@ function SettingsWindow() {
|
|||||||
document.body.removeEventListener('touchmove',prevent,false);
|
document.body.removeEventListener('touchmove',prevent,false);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
this.hideSettings = function() {
|
this.hideSettings = function(complete) {
|
||||||
$("#contentOverlay").fadeOut(375, function() {
|
$("#contentOverlay").fadeOut(375, function() {
|
||||||
document.body.addEventListener('touchmove',prevent,false);
|
document.body.addEventListener('touchmove',prevent,false);
|
||||||
// self.window.css("display","none");
|
// self.window.css("display","none");
|
||||||
|
complete();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user