Fix subscription targets

This commit is contained in:
Liam 2024-03-03 00:31:06 -05:00
parent 9b766733a5
commit 49e94afa1e
8 changed files with 11 additions and 11 deletions

View file

@ -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;
});

View file

@ -1,2 +1,2 @@
#js-subscription-target
' Error!
.js-subscription-target
' Error!

View file

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

View file

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

View file

@ -1,2 +1,2 @@
#js-subscription-target
' Error!
.js-subscription-target
' Error!

View file

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

View file

@ -1,2 +1,2 @@
#js-subscription-target
' Error!
.js-subscription-target
' Error!

View file

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