Skip to content

Commit

Permalink
admin: Add No-change-made message.
Browse files Browse the repository at this point in the history
A 'no changes made' message is displayed whenever save-changes button
is clicked, albeit no changes are made in the admin page.
  • Loading branch information
jajodiaraghav authored and timabbott committed Jan 26, 2017
1 parent 06cd40d commit fc965eb
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions static/js/admin.js
Original file line number Diff line number Diff line change
Expand Up @@ -657,6 +657,16 @@ function _setup_page() {
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) {
var reason = $.parseJSON(xhr.responseText).reason;
Expand Down

0 comments on commit fc965eb

Please sign in to comment.