You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Dec 26, 2023. It is now read-only.
Do the client side events occur when a Stream changes the DOM?
I have a Stream adding a Bootstrap toast as push notification message to a user that works reasonably well - But I can either show the Toast directly by attribute (class show) - then it is never faded, and the user has to remove it by click on the close button.
Or, what I really want, is keep it hidden, and call bootstrap's javascript to show it, which starts a counter, and removes it again after a period of time.
But therefore I need to respond to a Js event like turbo:frame:load. According to this discussion, this event is not triggered if the HTML comes from a Stream.
document.documentElement.addEventListener("turbo:frame-load",evt=>{console.log("A new TurboFrame appeared:",evt.target);})
Is there anything I can do to trigger a client side event when a Stream's HTML comes in?
I saw that turbo-django.js has defined some events - but I am not Js-smart enough to understand that code properly.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Do the client side events occur when a Stream changes the DOM?
I have a Stream adding a Bootstrap toast as push notification message to a user that works reasonably well - But I can either show the Toast directly by attribute (class show) - then it is never faded, and the user has to remove it by click on the close button.
Or, what I really want, is keep it hidden, and call bootstrap's javascript to show it, which starts a counter, and removes it again after a period of time.
But therefore I need to respond to a Js event like
turbo:frame:load
. According to this discussion, this event is not triggered if the HTML comes from a Stream.Is there anything I can do to trigger a client side event when a Stream's HTML comes in?
I saw that turbo-django.js has defined some events - but I am not Js-smart enough to understand that code properly.
Beta Was this translation helpful? Give feedback.
All reactions