1 line
922 B
JavaScript
1 line
922 B
JavaScript
|
var wp_optimize=window.wp_optimize||{};!function(e,t){"use strict";var i={};i.views={},i.views.modal=Backbone.View.extend({tagName:"div",template:t.template("wpo-modal"),preinitialize:function(){this.events=_.extend(this.events||{},{"click .wpo-modal--close":"close"}),this.className=this.className?"wpo-modal--container "+this.className:"wpo-modal--container "},render:function(){this.$el.append(this.template()),this.trigger("rendered")},initialize:function(){this.trigger("initialize"),this.render(),this.$content=this.$el.find(".wpo-modal--content"),"function"==typeof this.content&&this.$content.append(this.content())},close:function(){e("body").removeClass("wpo-modal-is-opened"),this.remove()}}),i.open=function(t){var o=_.extend(t||{},{}),n=i.views.modal.extend(o),s=new n;return s.$el.appendTo("body"),s.$(".wpo-modal").focus(),e("body").addClass("wpo-modal-is-opened"),s},wp_optimize.modal=i}(jQuery,window.wp);
|