From af6de2053e09ea5f596152d4c99d1987c47977f2 Mon Sep 17 00:00:00 2001 From: Steve Howell Date: Fri, 25 Oct 2013 17:52:45 -0400 Subject: [PATCH] Give Notifications settings its own alert area. (imported from commit 1d17b85f383862d1f37b5750af40aa8d9a1d8bf2) --- static/js/ui.js | 10 +++++++--- templates/zerver/settings.html | 8 +++++++- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/static/js/ui.js b/static/js/ui.js index c75b61a1a8..5a857b382d 100644 --- a/static/js/ui.js +++ b/static/js/ui.js @@ -973,7 +973,8 @@ $(function () { password_quality($('#new_password').val(), $('#pw_strength .bar')); }); - var settings_status = $('#settings-status'); + var settings_status = $('#settings-status').expectOne(); + var notify_settings_status = $('#notify-settings-status').expectOne(); function settings_change_error(message) { // Scroll to the top so the error message is visible. @@ -1059,7 +1060,7 @@ $(function () { page_params.enable_offline_push_notifications = result.enable_offline_push_notifications; } - settings_status.removeClass(status_classes) + notify_settings_status.removeClass(status_classes) .addClass('alert-success') .text(message).stop(true).fadeTo(0,1); // TODO: In theory we should auto-reload or something if @@ -1073,7 +1074,10 @@ $(function () { // a nice response. response += ": " + $.parseJSON(xhr.responseText).msg; } - settings_change_error(response); + + notify_settings_status.removeClass(status_classes) + .addClass('alert-error') + .text(response).stop(true).fadeTo(0,1); } }); diff --git a/templates/zerver/settings.html b/templates/zerver/settings.html index 4e74a1e1c6..476744cf11 100644 --- a/templates/zerver/settings.html +++ b/templates/zerver/settings.html @@ -2,9 +2,10 @@

Settings

-
+
+ + + +
+ +
{% csrf_token %}