You've already forked algora-tv
							
							
				mirror of
				https://github.com/algora-io/tv.git
				synced 2025-10-30 23:07:56 +02:00 
			
		
		
		
	add phx:js-exec listener
This commit is contained in:
		| @@ -374,6 +374,12 @@ window.addEventListener("phx:page-loading-stop", (info) => topbar.hide()); | ||||
| // Accessible routing | ||||
| window.addEventListener("phx:page-loading-stop", routeUpdated); | ||||
|  | ||||
| window.addEventListener("phx:js-exec", ({ detail }) => { | ||||
|   document.querySelectorAll(detail.to).forEach((el) => { | ||||
|     liveSocket.execJS(el, el.getAttribute(detail.attr)); | ||||
|   }); | ||||
| }); | ||||
|  | ||||
| window.addEventListener("js:exec", (e) => | ||||
|   e.target[e.detail.call](...e.detail.args) | ||||
| ); | ||||
|   | ||||
		Reference in New Issue
	
	Block a user