完善alert组件
This commit is contained in:
parent
408398e46b
commit
41b715c62b
|
@ -166,26 +166,24 @@
|
|||
})
|
||||
|
||||
var Alert = $.create({
|
||||
installed: function () {
|
||||
$(this.ok).on("click", function (evt) {
|
||||
this.option.display = false;
|
||||
evt.stopPropagation();
|
||||
}.bind(this));
|
||||
hide: function (evt) {
|
||||
this.option.display = false;
|
||||
evt.stopPropagation();
|
||||
},
|
||||
render: function () {
|
||||
if (!this.option.display) return;
|
||||
return '<div>\
|
||||
<div class="ui-mask" style="height:' + (Math.max(document.body.scrollHeight, document.body.clientHeight) - 1) + 'px;"></div>\
|
||||
<div class="ui-dialog">\
|
||||
<div class="ui-dialog-title">\
|
||||
<h3>{{title}}</h3>\
|
||||
</div>\
|
||||
<div class="ui-dialog-content">\
|
||||
<div title="{{msg}}">\
|
||||
<p>{{msg}}</p></div>\
|
||||
<div class="ui-dialog" style="top:' + ((document.body.scrollTop || document.documentElement.scrollTop) + window.innerHeight / 2) + 'px">\
|
||||
<div class="ui-dialog-title">\
|
||||
<h3>{{title}}</h3>\
|
||||
</div>\
|
||||
<div class="ui-dialog-content">\
|
||||
<div title="{{msg}}">\
|
||||
<p>{{msg}}</p></div>\
|
||||
</div>\
|
||||
<div onclick="hide(event)" class="ui-dialog-btns"><a class="ui-btn ui-btn-1">好</a>\
|
||||
</div>\
|
||||
<div nc-id="ok" class="ui-dialog-btns"><a class="ui-btn ui-btn-1">好</a>\
|
||||
</div>\
|
||||
</div>\
|
||||
</div>';
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue