Fixed bug with clicking custom again not opening modal

This commit is contained in:
Phil Hughes 2016-06-17 15:17:23 +01:00
parent fd15e81444
commit 83446ce7be
2 changed files with 4 additions and 1 deletions

View File

@ -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')

View File

@ -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")