AlertifyJS 有一个放置辅助按钮的地方。
当我的辅助按钮被点击时,我希望发生两件事
- 对话框不应关闭
- 应该运行一些功能
我该怎么做这两件事?
我可以通过将通知作为第三个参数传递来显示通知,但对话框消失了。此外,如果我有多个辅助按钮和每个不同的功能,这将不起作用。
下面是我的 javascript,这里是一个 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();