MDL-64573 output: ajax form event
[moodle.git] / lib / amd / build / event.min.js
CommitLineData
260565e3 1define(["jquery","core/yui"],function(a,b){return{Events:{FORM_FIELD_VALIDATION:"core_form-field-validation"},getLegacyEvents:function(){var c=a.Deferred();return b.use("event","moodle-core-event",function(){c.resolve(window.M.core.event)}),c.promise()},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})})},notifyFormSubmitAjax:function(c,d){d=d||!1,b.use("event","moodle-core-event",function(b){d&&(window.skipClientValidation=!0),a(c).trigger(M.core.event.FORM_SUBMIT_AJAX),b.one(c).fire(M.core.event.FORM_SUBMIT_AJAX,{currentTarget:b.one(c)}),d&&(window.skipClientValidation=!1)})},notifyEditorContentRestored:function(){b.use("event","moodle-core-event",function(b){a(document).trigger(M.core.event.EDITOR_CONTENT_RESTORED),b.fire(M.core.event.EDITOR_CONTENT_RESTORED)})}}});