♻ Remove onWizardPreventSettingsRefreshDialog
Makes the whole wizard stuff less complex.
This commit is contained in:
1 parent
40396847e3
commit
6097222b7b
3 files changed
+1
-36
No files matched your search
@@ -170,10 +170,6 @@ $(function() {
|
||||
return false;
|
||||
};
|
||||
|
||||
self.onWizardPreventSettingsRefreshDialog = function() {
|
||||
return self.active;
|
||||
};
|
||||
|
||||
self.onWizardDetails = function(response) {
|
||||
self.required = response && response.corewizard && response.corewizard.details && response.corewizard.details.onlinecheck && response.corewizard.details.onlinecheck.required;
|
||||
};
|
||||
@@ -252,10 +248,6 @@ $(function() {
|
||||
return false;
|
||||
};
|
||||
|
||||
self.onWizardPreventSettingsRefreshDialog = function() {
|
||||
return self.active;
|
||||
};
|
||||
|
||||
self.onWizardDetails = function(response) {
|
||||
self.required = response && response.corewizard && response.corewizard.details && response.corewizard.details.pluginblacklist && response.corewizard.details.pluginblacklist.required;
|
||||
};
|
||||
|
||||
@@ -44,10 +44,6 @@ $(function() {
|
||||
return false;
|
||||
};
|
||||
|
||||
self.onWizardPreventSettingsRefreshDialog = function() {
|
||||
return self.active();
|
||||
};
|
||||
|
||||
self.onWizardDetails = function(response) {
|
||||
self.required = response && response.tracking && response.tracking.required;
|
||||
};
|
||||
|
||||
@@ -193,30 +193,7 @@ $(function() {
|
||||
};
|
||||
|
||||
self.onSettingsPreventRefresh = function() {
|
||||
if (!self.finishing && self.isDialogActive()
|
||||
&& hasDataChanged(self.settingsViewModel.getLocalData(), self.settingsViewModel.lastReceivedSettings)) {
|
||||
var preventSettingsRefreshDialog = false;
|
||||
callViewModels(self.allViewModels, "onWizardPreventSettingsRefreshDialog", function(method) {
|
||||
// if any of our methods returns that it wants to prevent the dialog
|
||||
// we'll need to set preventSettingsRefreshDialog to true
|
||||
//
|
||||
// order is important here - the method call needs to happen
|
||||
// first, or it won't happen after the flag has been
|
||||
// set once due to the || making further evaluation unnecessary
|
||||
// then
|
||||
preventSettingsRefreshDialog = (method() === true) || preventSettingsRefreshDialog;
|
||||
});
|
||||
|
||||
// we have local changes, show update dialog
|
||||
if (preventSettingsRefreshDialog) {
|
||||
return false;
|
||||
} else {
|
||||
self.settingsViewModel.settingsUpdatedDialog.modal("show");
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
return self.isDialogActive();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user