Skip to content

Commit

Permalink
messageBox and confirm box
Browse files Browse the repository at this point in the history
  • Loading branch information
bigxxs authored Aug 5, 2018
1 parent 82baa24 commit 5cd3c40
Showing 1 changed file with 42 additions and 6 deletions.
48 changes: 42 additions & 6 deletions kmui.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,50 @@
var btnDefine = options.buttons[i]
var btn = $('<a href="javascript:void(0);"></a>').appendTo(buttons);
btn.text(btnDefine.text);
btn.click(function () {
btnDefine.click();
__dialog.hide();
kmui.hideMask();
});
btn.bind('click', btnDefine.click)
.bind('click', function () {
__dialog.hide();
kmui.hideMask();
});
}
__dialog.show();
}
},
messageBox: function (title, content) {
kmui.dialog({
title: title,
content: content,
buttons: [
{
text: "确定",
click: function () {
return true;
}
}
]
});
},
confirm: function (title, content, callback) {
kmui.dialog({
title: title,
content: content,
buttons: [
{
text: "取消",
click: function () {
callback(false);
return true;
}
},
{
text: "确定",
click: function () {
callback(true);
return true;
}
}
]
});
},
};

window.kmui = kmui;
Expand Down

0 comments on commit 5cd3c40

Please sign in to comment.