From 83446ce7becf3f8af49694529a44e85ada0131c9 Mon Sep 17 00:00:00 2001 From: Phil Hughes Date: Fri, 17 Jun 2016 15:17:23 +0100 Subject: [PATCH] Fixed bug with clicking custom again not opening modal --- app/assets/javascripts/notifications_dropdown.js.coffee | 3 +++ .../shared/notifications/_notification_dropdown.html.haml | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/app/assets/javascripts/notifications_dropdown.js.coffee b/app/assets/javascripts/notifications_dropdown.js.coffee index 15daf027c0a..c13010f56ec 100644 --- a/app/assets/javascripts/notifications_dropdown.js.coffee +++ b/app/assets/javascripts/notifications_dropdown.js.coffee @@ -4,6 +4,9 @@ class @NotificationsDropdown .off 'click', '.update-notification' .on 'click', '.update-notification', (e) -> e.preventDefault() + + return if $(this).is('.is-active') and $(this).data('notification-level') is 'custom' + notificationLevel = $(@).data 'notification-level' label = $(@).data 'notification-title' form = $(this).parents('form:first') diff --git a/app/views/shared/notifications/_notification_dropdown.html.haml b/app/views/shared/notifications/_notification_dropdown.html.haml index 969bc29b1a6..5c19876e971 100644 --- a/app/views/shared/notifications/_notification_dropdown.html.haml +++ b/app/views/shared/notifications/_notification_dropdown.html.haml @@ -8,6 +8,6 @@ %li.divider %li - %a.update-notification{ href: "#", role: "button", data: { toggle: "modal", target: "#" + notifications_menu_identifier("modal", notification_setting), notification_level: "custom", notification_title: "Custom" } } + %a.update-notification{ href: "#", role: "button", class: ("is-active" if notification_setting.level == "custom"), data: { toggle: "modal", target: "#" + notifications_menu_identifier("modal", notification_setting), notification_level: "custom", notification_title: "Custom" } } %strong.dropdown-menu-inner-title Custom %span.dropdown-menu-inner-content= notification_description("custom")