Current Path : /var/www/ljmtc/cbt/calendar/amd/build/ |
Current File : /var/www/ljmtc/cbt/calendar/amd/build/summary_modal.min.js |
define ("core_calendar/summary_modal",["jquery","core/str","core/notification","core/custom_interaction_events","core/modal","core/modal_registry","core/modal_factory","core/modal_events","core_calendar/repository","core_calendar/events","core_calendar/crud"],function(a,b,c,d,e,f,g,h,i,j,k){var l=!1,m={ROOT:"[data-region='summary-modal-container']",EDIT_BUTTON:"[data-action=\"edit\"]",DELETE_BUTTON:"[data-action=\"delete\"]"},n=function(a){e.call(this,a)};n.TYPE="core_calendar-event_summary";n.prototype=Object.create(e.prototype);n.prototype.constructor=n;n.prototype.getEditButton=function(){if("undefined"==typeof this.editButton){this.editButton=this.getFooter().find(m.EDIT_BUTTON)}return this.editButton};n.prototype.getDeleteButton=function(){if("undefined"==typeof this.deleteButton){this.deleteButton=this.getFooter().find(m.DELETE_BUTTON)}return this.deleteButton};n.prototype.getEventId=function(){return this.getBody().find(m.ROOT).attr("data-event-id")};n.prototype.getEventTitle=function(){return this.getBody().find(m.ROOT).attr("data-event-title")};n.prototype.getEventCount=function(){return this.getBody().find(m.ROOT).attr("data-event-count")};n.prototype.getEditUrl=function(){return this.getBody().find(m.ROOT).attr("data-edit-url")};n.prototype.isActionEvent=function(){return"true"==this.getBody().find(m.ROOT).attr("data-action-event")};n.prototype.registerEventListeners=function(){e.prototype.registerEventListeners.call(this);M.util.js_pending("core_calendar/summary_modal:registerEventListeners:bodyRendered");this.getRoot().on(h.bodyRendered,function(){this.getModal().data({eventTitle:this.getEventTitle(),eventId:this.getEventId(),eventCount:this.getEventCount()}).attr("data-type","event");k.registerRemove(this.getModal());M.util.js_complete("core_calendar/summary_modal:registerEventListeners:bodyRendered")}.bind(this));a("body").on(j.deleted,function(){this.hide()}.bind(this));d.define(this.getEditButton(),[d.events.activate]);this.getEditButton().on(d.events.activate,function(b,c){if(this.isActionEvent()){a("body").trigger(j.editActionEvent,[this.getEditUrl()])}else{a("body").trigger(j.editEvent,[this.getEventId()])}this.hide();b.preventDefault();b.stopPropagation();c.originalEvent.preventDefault();c.originalEvent.stopPropagation()}.bind(this))};if(!l){f.register(n.TYPE,n,"core_calendar/event_summary_modal");l=!0}return n}); //# sourceMappingURL=summary_modal.min.js.map