mirror of
https://github.com/Doodle3D/doodle3d-client.git
synced 2024-11-22 09:17:56 +01:00
Reenabling Settings ok button when validation failed
This commit is contained in:
parent
8550cc586a
commit
2e09d8bccb
@ -134,10 +134,14 @@ function SettingsWindow() {
|
|||||||
disableButton(self.btnOK,self.submitwindow);
|
disableButton(self.btnOK,self.submitwindow);
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
self.saveSettings(self.readForm(),function(){
|
self.saveSettings(self.readForm(),function(success){
|
||||||
self.hideSettings(function() {
|
if(success) {
|
||||||
|
self.hideSettings(function() {
|
||||||
|
enableButton(self.btnOK,self.submitwindow);
|
||||||
|
});
|
||||||
|
} else {
|
||||||
enableButton(self.btnOK,self.submitwindow);
|
enableButton(self.btnOK,self.submitwindow);
|
||||||
});
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
clearTimeout(self.retryRetrieveNetworkStatusDelay);
|
clearTimeout(self.retryRetrieveNetworkStatusDelay);
|
||||||
@ -231,7 +235,7 @@ function SettingsWindow() {
|
|||||||
console.log("Settings:saveSettings response: ",response);
|
console.log("Settings:saveSettings response: ",response);
|
||||||
if(response.status == "error") {
|
if(response.status == "error") {
|
||||||
clearTimeout(self.retrySaveSettingsDelay);
|
clearTimeout(self.retrySaveSettingsDelay);
|
||||||
self.retrySaveSettingsDelay = setTimeout(function() { self.saveSettings(settings) },self.retryDelay); // retry after delay
|
self.retrySaveSettingsDelay = setTimeout(function() { self.saveSettings(settings,complete) },self.retryDelay); // retry after delay
|
||||||
} else {
|
} else {
|
||||||
var data = response.data;
|
var data = response.data;
|
||||||
var validation = data.validation;
|
var validation = data.validation;
|
||||||
@ -245,13 +249,13 @@ function SettingsWindow() {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
settings.substituted_ssid = data.substituted_ssid;
|
settings.substituted_ssid = data.substituted_ssid;
|
||||||
if(complete && validated) complete();
|
if(complete) complete(validated);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}).fail(function() {
|
}).fail(function() {
|
||||||
console.log("Settings:saveSettings: failed");
|
console.log("Settings:saveSettings: failed");
|
||||||
clearTimeout(self.retrySaveSettingsDelay);
|
clearTimeout(self.retrySaveSettingsDelay);
|
||||||
self.retrySaveSettingsDelay = setTimeout(function() { self.saveSettings(settings) },self.retryDelay); // retry after delay
|
self.retrySaveSettingsDelay = setTimeout(function() { self.saveSettings(settings,complete) },self.retryDelay); // retry after delay
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -566,8 +570,8 @@ function SettingsWindow() {
|
|||||||
if (communicateWithWifibox) {
|
if (communicateWithWifibox) {
|
||||||
|
|
||||||
// save network related settings and on complete, connect to network
|
// save network related settings and on complete, connect to network
|
||||||
self.saveSettings(self.readForm(),function() {
|
self.saveSettings(self.readForm(),function(success) {
|
||||||
|
if(!success) return;
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: self.wifiboxCGIBinURL + "/network/associate",
|
url: self.wifiboxCGIBinURL + "/network/associate",
|
||||||
type: "POST",
|
type: "POST",
|
||||||
@ -597,7 +601,8 @@ function SettingsWindow() {
|
|||||||
if (communicateWithWifibox) {
|
if (communicateWithWifibox) {
|
||||||
|
|
||||||
// save network related settings and on complete, create access point
|
// save network related settings and on complete, create access point
|
||||||
self.saveSettings(self.readForm(),function() {
|
self.saveSettings(self.readForm(),function(success) {
|
||||||
|
if(!success) return;
|
||||||
self.setAPModeState(SettingsWindow.CREATING_AP); // get latest substituted ssid
|
self.setAPModeState(SettingsWindow.CREATING_AP); // get latest substituted ssid
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: self.wifiboxCGIBinURL + "/network/openap",
|
url: self.wifiboxCGIBinURL + "/network/openap",
|
||||||
|
Loading…
Reference in New Issue
Block a user