mirror of
https://github.com/moodle/moodle.git
synced 2025-04-22 08:55:15 +02:00
Merge branch 'MDL-79031-master' of https://github.com/NashTechOpenUniversity/moodle
This commit is contained in:
commit
89223fa386
2
filter/amd/build/events.min.js
vendored
2
filter/amd/build/events.min.js
vendored
@ -13,6 +13,6 @@ define("core_filters/events",["exports","core/event_dispatcher","core/normalise"
|
||||
* document.addEventListener(filterEventTypes.filterContentUpdated, e => {
|
||||
* window.console.log(e.detail.nodes); // A list of the HTMLElements whose content was updated
|
||||
* });
|
||||
*/Object.defineProperty(_exports,"__esModule",{value:!0}),_exports.notifyFilterContentUpdated=_exports.eventTypes=void 0,_jquery=(obj=_jquery)&&obj.__esModule?obj:{default:obj};const eventTypes={filterContentUpdated:"core_filters/contentUpdated"};_exports.eventTypes=eventTypes;_exports.notifyFilterContentUpdated=nodes=>(nodes=(0,_normalise.getList)(nodes),(0,_event_dispatcher.dispatchEvent)(eventTypes.filterContentUpdated,{nodes:nodes}));let legacyEventsRegistered=!1;legacyEventsRegistered||(Y.use("event","moodle-core-event",(()=>{document.addEventListener(eventTypes.filterContentUpdated,(e=>{(0,_jquery.default)(document).trigger(M.core.event.FILTER_CONTENT_UPDATED,[(0,_jquery.default)(e.detail.nodes)]),Y.fire(M.core.event.FILTER_CONTENT_UPDATED,{nodes:new Y.NodeList(e.detail.nodes)})}))})),legacyEventsRegistered=!0)}));
|
||||
*/Object.defineProperty(_exports,"__esModule",{value:!0}),_exports.notifyFilterContentUpdated=_exports.notifyFilterContentRenderingComplete=_exports.eventTypes=void 0,_jquery=(obj=_jquery)&&obj.__esModule?obj:{default:obj};const eventTypes={filterContentUpdated:"core_filters/contentUpdated",filterContentRenderingComplete:"core_filters/contentRenderingComplete"};_exports.eventTypes=eventTypes;_exports.notifyFilterContentUpdated=nodes=>(nodes=(0,_normalise.getList)(nodes),(0,_event_dispatcher.dispatchEvent)(eventTypes.filterContentUpdated,{nodes:nodes}));_exports.notifyFilterContentRenderingComplete=nodes=>(0,_event_dispatcher.dispatchEvent)(eventTypes.filterContentRenderingComplete,{nodes:nodes});let legacyEventsRegistered=!1;legacyEventsRegistered||(Y.use("event","moodle-core-event",(()=>{document.addEventListener(eventTypes.filterContentUpdated,(e=>{(0,_jquery.default)(document).trigger(M.core.event.FILTER_CONTENT_UPDATED,[(0,_jquery.default)(e.detail.nodes)]),Y.fire(M.core.event.FILTER_CONTENT_UPDATED,{nodes:new Y.NodeList(e.detail.nodes)})}))})),legacyEventsRegistered=!0)}));
|
||||
|
||||
//# sourceMappingURL=events.min.js.map
|
File diff suppressed because one or more lines are too long
@ -37,6 +37,7 @@ import jQuery from 'jquery';
|
||||
*
|
||||
* @constant
|
||||
* @property {String} filterContentUpdated See {@link event:filterContentUpdated}
|
||||
* @property {String} filterContentRenderingComplete See {@link event:filterContentRenderingComplete}
|
||||
*/
|
||||
export const eventTypes = {
|
||||
/**
|
||||
@ -51,6 +52,15 @@ export const eventTypes = {
|
||||
* @property {NodeElement[]} detail.nodes The list of parent nodes which were updated
|
||||
*/
|
||||
filterContentUpdated: 'core_filters/contentUpdated',
|
||||
|
||||
/**
|
||||
* An event triggered when filter system have done rendering the content using the filter system.
|
||||
*
|
||||
* @event filterContentRenderingComplete
|
||||
* @type {CustomEvent}
|
||||
* @property {object} detail
|
||||
*/
|
||||
filterContentRenderingComplete: 'core_filters/contentRenderingComplete',
|
||||
};
|
||||
|
||||
/**
|
||||
@ -69,6 +79,18 @@ export const notifyFilterContentUpdated = nodes => {
|
||||
return dispatchEvent(eventTypes.filterContentUpdated, {nodes});
|
||||
};
|
||||
|
||||
/**
|
||||
* Trigger an event to indicate that the filter has been processed.
|
||||
*
|
||||
* @method notifyFilterContentRenderingComplete
|
||||
* @param {NodeList|Node[]} nodes List of nodes that has been modified by filter
|
||||
* @returns {CustomEvent}
|
||||
* @fires filterContentRenderingComplete
|
||||
*/
|
||||
export const notifyFilterContentRenderingComplete = nodes => {
|
||||
return dispatchEvent(eventTypes.filterContentRenderingComplete, {nodes});
|
||||
};
|
||||
|
||||
let legacyEventsRegistered = false;
|
||||
if (!legacyEventsRegistered) {
|
||||
// The following event triggers are legacy and will be removed in the future.
|
||||
|
@ -139,6 +139,7 @@ being forced open in all behat tests.
|
||||
* A new parameter $loginrecaptcha has been added to the authenticate_user_login() to check whether the login captcha is needed to verify or not. The default value is false.
|
||||
* A new parameter $compactmode has been added to the recaptcha_get_challenge_html() to define whether the reCaptcha element should be displayed in the compact mode or not.
|
||||
Default value is false.
|
||||
* A new native event in the `core_filters/events` AMD module eventTypes.filterContentRenderingComplete has been created to determine when the filter is complete the rendering.
|
||||
|
||||
=== 4.2 ===
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user