【发布时间】:2015-03-06 17:15:21
【问题描述】:
AlertifyJS 有一个放置辅助按钮的地方。
我希望在点击我的辅助按钮时发生两件事
- 对话框不应关闭
- 应该运行一些函数
这两件事我该怎么做?
我可以通过将通知作为第三个参数传递来显示通知,但对话框消失了。此外,如果我有多个辅助按钮和每个不同的功能,这将不起作用。
下面是我的 javascript 和 here is a JSFiddle。
// Run this function when the auxiliary button is clicked
// And do not close the dialog
var helpInfo = function () {
alertify.notify("help help help");
};
var custom = function () {
if (!alertify.helper) {
alertify.dialog('helper', function factory() {
return {
setup: function () {
return {
buttons: [{
text: 'Help',
scope: 'auxiliary'
}],
options: {
modal: false
}
};
}
};
}, false, 'alert');
}
alertify.helper('Do you need help?', "hello world", helpInfo);
};
custom();
【问题讨论】:
标签: alertifyjs