/
var
/
www
/
html
/
lgpd
/
lib
/
amd
/
build
/
Upload File
HOME
define ("core/modal_factory",["jquery","core/modal_events","core/modal_registry","core/modal","core/modal_save_cancel","core/modal_cancel","core/templates","core/notification","core/custom_interaction_events"],function(a,b,c,d,e,f,g,h,i){var j={DEFAULT:"core/modal",SAVE_CANCEL:"core/modal_save_cancel",CANCEL:"core/modal_cancel"},k={DEFAULT:"DEFAULT",SAVE_CANCEL:"SAVE_CANCEL",CANCEL:"CANCEL"};c.register(k.DEFAULT,d,j.DEFAULT);c.register(k.SAVE_CANCEL,e,j.SAVE_CANCEL);c.register(k.CANCEL,f,j.CANCEL);var l=function(c,d,e){var f=null,g="function"==typeof e.preShowCallback,h=function(b,d){f=a(b.currentTarget);c.then(function(a){if(g){e.preShowCallback(f,a)}a.show();return a});d.originalEvent.preventDefault()};if(Array.isArray(d)){var j=d[1];d=d[0];i.define(d,[i.events.activate]);d.on(i.events.activate,j,h)}else{i.define(d,[i.events.activate]);d.on(i.events.activate,h)}c.then(function(a){a.getRoot().on(b.hidden,function(){if(null!==f){f.focus()}});return a})},m=function(b,c){c=a(c);var d=b.module,e=new d(c);return e},n=function(b,c){var d=b.template,e=g.render(d,c).then(function(c){var d=a(c);return m(b,d)}).fail(h.exception);return e};return{create:function create(a,b){var d=a.type||k.DEFAULT,e=a.large?!0:!1,f=null,g={};f=c.get(d);if(!f){h.exception({message:"Unable to find modal of type: "+d})}if("undefined"!=typeof a.templateContext){g=a.templateContext}var i=n(f,g).then(function(b){if("undefined"!=typeof a.title){b.setTitle(a.title)}if("undefined"!=typeof a.body){b.setBody(a.body)}if("undefined"!=typeof a.footer){b.setFooter(a.footer)}if(e){b.setLarge()}return b});if("undefined"!=typeof b){l(i,b,a)}return i},types:k}}); //# sourceMappingURL=modal_factory.min.js.map