diff --git a/assets/js/notifications.js b/assets/js/notifications.js index 4ff157755..2447debbf 100644 --- a/assets/js/notifications.js +++ b/assets/js/notifications.js @@ -17,7 +17,7 @@ function makeRequest(verb) { function bindSubscriptionLinks() { delegate(document, 'fetchcomplete', { '.js-subscription-link': event => { - const target = $('#js-subscription-target'); + const target = event.target.closest('.js-subscription-target'); event.detail.text().then(text => { target.outerHTML = text; }); diff --git a/lib/philomena_web/templates/channel/subscription/_error.html.slime b/lib/philomena_web/templates/channel/subscription/_error.html.slime index b0c027de6..dd0794241 100644 --- a/lib/philomena_web/templates/channel/subscription/_error.html.slime +++ b/lib/philomena_web/templates/channel/subscription/_error.html.slime @@ -1,2 +1,2 @@ -#js-subscription-target - ' Error! \ No newline at end of file +.js-subscription-target + ' Error! diff --git a/lib/philomena_web/templates/channel/subscription/_subscription.html.slime b/lib/philomena_web/templates/channel/subscription/_subscription.html.slime index c12b47fad..362d91154 100644 --- a/lib/philomena_web/templates/channel/subscription/_subscription.html.slime +++ b/lib/philomena_web/templates/channel/subscription/_subscription.html.slime @@ -6,7 +6,7 @@ elixir: unwatch_class = if @watching, do: "", else: "hidden" = if @conn.assigns.current_user do - span#js-subscription-target + span.js-subscription-target a.js-subscription-link.media-box__header.media-box__header--channel.media-box__header--link href=watch_path class=watch_class data-remote="true" data-method="post" i.fa.fa-bell> span.hide-mobile diff --git a/lib/philomena_web/templates/forum/subscription/_subscription.html.slime b/lib/philomena_web/templates/forum/subscription/_subscription.html.slime index 1477c4e7a..f71096cd0 100644 --- a/lib/philomena_web/templates/forum/subscription/_subscription.html.slime +++ b/lib/philomena_web/templates/forum/subscription/_subscription.html.slime @@ -6,7 +6,7 @@ elixir: unwatch_class = if @watching, do: "", else: "hidden" = if @conn.assigns.current_user do - span#js-subscription-target + span.js-subscription-target a.js-subscription-link href=watch_path class=watch_class data-remote="true" data-method="post" i.fa.fa-bell> span.hide-mobile diff --git a/lib/philomena_web/templates/gallery/subscription/_error.html.slime b/lib/philomena_web/templates/gallery/subscription/_error.html.slime index b0c027de6..dd0794241 100644 --- a/lib/philomena_web/templates/gallery/subscription/_error.html.slime +++ b/lib/philomena_web/templates/gallery/subscription/_error.html.slime @@ -1,2 +1,2 @@ -#js-subscription-target - ' Error! \ No newline at end of file +.js-subscription-target + ' Error! diff --git a/lib/philomena_web/templates/gallery/subscription/_subscription.html.slime b/lib/philomena_web/templates/gallery/subscription/_subscription.html.slime index 55cec2704..b6c5d895d 100644 --- a/lib/philomena_web/templates/gallery/subscription/_subscription.html.slime +++ b/lib/philomena_web/templates/gallery/subscription/_subscription.html.slime @@ -6,7 +6,7 @@ elixir: unwatch_class = if @watching, do: "", else: "hidden" = if @conn.assigns.current_user do - span#js-subscription-target + span.js-subscription-target a.js-subscription-link href=watch_path class=watch_class data-remote="true" data-method="post" i.fa.fa-bell> span.hide-mobile diff --git a/lib/philomena_web/templates/image/subscription/_error.html.slime b/lib/philomena_web/templates/image/subscription/_error.html.slime index b0c027de6..dd0794241 100644 --- a/lib/philomena_web/templates/image/subscription/_error.html.slime +++ b/lib/philomena_web/templates/image/subscription/_error.html.slime @@ -1,2 +1,2 @@ -#js-subscription-target - ' Error! \ No newline at end of file +.js-subscription-target + ' Error! diff --git a/lib/philomena_web/templates/image/subscription/_subscription.html.slime b/lib/philomena_web/templates/image/subscription/_subscription.html.slime index 063fd896c..35c6883dc 100644 --- a/lib/philomena_web/templates/image/subscription/_subscription.html.slime +++ b/lib/philomena_web/templates/image/subscription/_subscription.html.slime @@ -6,7 +6,7 @@ elixir: unwatch_class = if @watching, do: "", else: "hidden" = if @conn.assigns.current_user do - span#js-subscription-target + span.js-subscription-target a.js-subscription-link href=watch_path class=watch_class data-remote="true" data-method="post" i.fa.fa-bell> ' Subscribe