I'm using a JavaScript library that calls window.confirm. The default browser dialog is pretty ugly so I'd like to override it by using the a Bootstrap themed confirmation dialog from the Bootbox library.
I can hook up the override to show the Bootbox confirm dialog but cannot get the response returned based on the user selection into the custom dialog. In the following case I need to call window._(true | false).
Here's the closest I've got. Any ideas?
function consume_confirm() {
if (window._confirm) return;
window._confirm = window.confirm;
window.confirm = function (message) {
var answer;
bootbox.confirm(message, function (result) {
answer = result;
});
return answer;
};
}