Authored by xuqi

support keep

... ... @@ -65,6 +65,7 @@ function Dialog(options) {
that.$mask = createMask();
}
that.$el = createDialog(opt);
that.opt = opt;
// 绑定x关闭事件
that.$el.find('.close').click(function() {
... ... @@ -87,7 +88,13 @@ function Dialog(options) {
Dialog.prototype.close = function() {
this.$mask && this.$mask.addClass('hide');
this.$el.remove();
// keep参数保持dialog不被remove而只是隐藏
if (this.opt.keep) {
this.$el.addClass('hide');
} else {
this.$el.remove();
}
return this;
};
... ...