admin: Add No-change-made message.

A 'no changes made' message is displayed whenever save-changes button
is clicked, albeit no changes are made in the admin page.
This commit is contained in:
Raghav Jajodia
2017-01-23 13:04:11 +05:30
committed by Tim Abbott
parent 06cd40d461
commit fc965eb5f6

View File

@@ -657,6 +657,16 @@ function _setup_page() {
ui.report_success(i18n.t("waiting period threshold changed!"), waiting_period_threshold_status); ui.report_success(i18n.t("waiting period threshold changed!"), waiting_period_threshold_status);
} }
} }
// Check if no changes made
var no_changes_made = true;
for (var key in response_data) {
if (['msg', 'result'].indexOf(key) < 0) {
no_changes_made = false;
}
}
if (no_changes_made) {
ui.report_success(i18n.t("No changes to save!"), name_status);
}
}, },
error: function (xhr) { error: function (xhr) {
var reason = $.parseJSON(xhr.responseText).reason; var reason = $.parseJSON(xhr.responseText).reason;