mirror of
https://github.com/moodle/moodle.git
synced 2025-01-18 05:58:34 +01:00
d4c6ac20c7
The legacy M.core.event.FILTER_CONTENT_UPDATED event has been replaced with a new core_filter/events::filterContentUpdated native DOM event. The new event can be triggered using the `notifyFilterContentUpdated` function, and by providing with an Array containing the HTMLElements that were updated, for example: ``` import {notifyFilterContentUpdated} from 'core_filter/events'; const someHandler = e => { // ... const nodeList = Array.from(document.querySelectorAll('div')); notifyFilterContentUpdated(nodeList); }; ``` The new event can be listened to at any point in the DOM using the following syntax: ``` import {eventTypes} from 'core_filter/events'; const handler = e => { // The list of HTMLElements in an Array. e.detail.nodes; }; document.addEventListener(eventTypes.filterContentUpdated, handler); ``` A backward-compatabibility layer is included to ensure that any legacy YUI event listener, or jQuery event listener are still called with the same arguments. This legacy bridges will be removed after Moodle 4.3.