mirror of
https://github.com/moodle/moodle.git
synced 2025-07-25 16:21:47 +02:00
When nodes are added to the dom, they may need to be re-processed by a JS based filter. To do this we need to trigger the legacy YUI event filter-content-updated. To make this easier I added some wrappers to template that will insert the node, run any JS and trigger the event. I also changed existing yui code to call the amd function to trigger the event. This way all jquery and yui listeners will always be notified.
1 line
293 B
JavaScript
1 line
293 B
JavaScript
define(["jquery","core/yui"],function(a,b){return{notifyFilterContentUpdated:function(c){c=a(c),b.use("event","moodle-core-event",function(b){a("document").trigger(M.core.event.FILTER_CONTENT_UPDATED,c);var d=new b.NodeList(c.get());b.fire(M.core.event.FILTER_CONTENT_UPDATED,{nodes:d})})}}}); |