define("content_b:component/modal/index",function(t,n,o){function e(t){this.options=t||{},this.template=i[this.options.type||"success"],this.dataSource=this.options.data||{},this.$element=null,this.$body=$("body"),this.create(),this.bindEvent(),this.init()}var i={success:'\n
\n'};e.prototype.create=function(){var t=_.template(this.template,{variable:"data"}),n=t(this.dataSource);this.destroy(),this.$element=$(n),this.$element.appendTo(this.$body)},e.prototype.bindEvent=function(){var t=this;this.$body.on("click",this.$element.find(".j-close"),function(){"function"==typeof t.options.onClose&&t.options.onClose()}),this.$body.on("click",this.$element.find(".j-cancel"),function(){"function"==typeof t.options.onCancel&&t.options.onCancel()}),this.$body.on("click",this.$element.find(".j-ok"),function(){"function"==typeof t.options.onOK&&t.options.onOK()})},e.prototype.init=function(){this.$element.find(".ui-modal").modal("show")},e.prototype.destroy=function(){this.$element&&this.$element.remove()},o.exports=e});