%PDF- %PDF-
Direktori : /home/vacivi36/ava/lib/amd/build/local/inplace_editable/ |
Current File : /home/vacivi36/ava/lib/amd/build/local/inplace_editable/events.min.js |
define("core/local/inplace_editable/events",["exports","jquery","core/event_dispatcher"],(function(_exports,_jquery,_event_dispatcher){var obj; /** * Inplace editable module events * * @module core/local/inplace_editable/events * @copyright 2021 Paul Holden <paulh@moodle.com> * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */Object.defineProperty(_exports,"__esModule",{value:!0}),_exports.notifyElementUpdated=_exports.notifyElementUpdateFailed=_exports.eventTypes=void 0,_jquery=(obj=_jquery)&&obj.__esModule?obj:{default:obj};const eventTypes={elementUpdated:"core/inplace_editable:updated",elementUpdateFailed:"core/inplace_editable:updateFailed"};_exports.eventTypes=eventTypes;_exports.notifyElementUpdated=(element,ajaxreturn,oldvalue)=>(0,_event_dispatcher.dispatchEvent)(eventTypes.elementUpdated,{ajaxreturn:ajaxreturn,oldvalue:oldvalue},element);_exports.notifyElementUpdateFailed=(element,exception,newvalue)=>(0,_event_dispatcher.dispatchEvent)(eventTypes.elementUpdateFailed,{exception:exception,newvalue:newvalue},element,{cancelable:!0});let legacyEventsRegistered=!1;legacyEventsRegistered||(document.addEventListener(eventTypes.elementUpdated,(event=>{const legacyEvent=_jquery.default.Event("updated",event.detail);(0,_jquery.default)(event.target).trigger(legacyEvent)})),document.addEventListener(eventTypes.elementUpdateFailed,(event=>{const legacyEvent=_jquery.default.Event("updatefailed",event.detail);(0,_jquery.default)(event.target).trigger(legacyEvent),legacyEvent.isDefaultPrevented()&&event.preventDefault()})),legacyEventsRegistered=!0)})); //# sourceMappingURL=events.min.js.map