【发布时间】:2017-05-02 06:35:24
【问题描述】:
我必须使用引导标准事件来监听所有模态隐藏事件:
$(document).on("hidden.bs.modal",".modal",function(){
...
});
我还需要将此事件用于引导框对话框,但这不起作用。查看我找到的引导箱源代码(https://github.com/makeusabrew/bootbox/blob/master/bootbox.js 的第 659 行):
dialog.one("hidden.bs.modal", function(e) {
// ensure we don't accidentally intercept hidden events triggered
// by children of the current dialog. We shouldn't anymore now BS
// namespaces its events; but still worth doing
if (e.target === this) {
dialog.remove();
}
});
如果这个 bootbox 回调在我的回调之前被调用,我就绝望了,因为这会破坏调用对象。
是否可以绕过这个问题?如何调用所有模式隐藏事件(也适用于引导框模式)?
【问题讨论】:
标签: twitter-bootstrap dom-events bootbox