From 605e122952e7c5595b2e977d29c03dc70930a848 Mon Sep 17 00:00:00 2001 From: Jacob Schatz Date: Tue, 21 Jun 2016 15:31:39 +0000 Subject: Merge branch 'notification-dropdown-active-fix' into 'master' Fixed issue with notification dropdown not updating active ## What does this MR do? This fixes an issue where the notification dropdown wouldn't correctly update the selected notification type in the dropdown. I've also added a spinner to show the action is happening & removed the flash message for success. ## What are the relevant issue numbers? Closes #18480 ## Screenshots (if relevant) ![notifications](/uploads/5ed5055d180c12450cea77543ae5f44e/notifications.gif) See merge request !4615 --- app/assets/javascripts/notifications_dropdown.js.coffee | 7 ++++--- app/assets/javascripts/project.js.coffee | 1 - 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'app/assets/javascripts') diff --git a/app/assets/javascripts/notifications_dropdown.js.coffee b/app/assets/javascripts/notifications_dropdown.js.coffee index 74d2298c1fa..0bbd082c156 100644 --- a/app/assets/javascripts/notifications_dropdown.js.coffee +++ b/app/assets/javascripts/notifications_dropdown.js.coffee @@ -1,5 +1,5 @@ class @NotificationsDropdown - $ -> + constructor: -> $(document) .off 'click', '.update-notification' .on 'click', '.update-notification', (e) -> @@ -18,7 +18,8 @@ class @NotificationsDropdown .off 'ajax:success', '.notification-form' .on 'ajax:success', '.notification-form', (e, data) -> if data.saved - new Flash('Notification settings saved', 'notice') - $(e.currentTarget).closest('.notification-dropdown').replaceWith(data.html) + $(e.currentTarget) + .closest('.notification-dropdown') + .replaceWith(data.html) else new Flash('Failed to save new settings', 'alert') diff --git a/app/assets/javascripts/project.js.coffee b/app/assets/javascripts/project.js.coffee index 54c539d5f9b..96e10dd7e8a 100644 --- a/app/assets/javascripts/project.js.coffee +++ b/app/assets/javascripts/project.js.coffee @@ -35,7 +35,6 @@ class @Project $(@).parents('.no-password-message').remove() e.preventDefault() - @projectSelectDropdown() projectSelectDropdown: -> -- cgit v1.2.3