Last active
August 29, 2015 14:08
-
-
Save trmcnvn/f44ffbb8087e8e9bcfc0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function confirm() { | |
CustomEvent.observe(LiveEvents.LIVE_BEFORE_WINDOW_LOAD, function(win) { | |
if (win.toString() !== "LiveWindowChatFloating") return; | |
win.box.setToolbarCloseOnClick(function() { | |
var confirm = window.confirm("Are you sure?"); | |
if (confirm !== false) { | |
CustomEvent.fire(LiveEvents.LIVE_EVENT, LiveEvents.LIVE_LEAVE_CHANNEL, this); | |
this.fire(LiveEvents.WINDOW_CLOSE); | |
} | |
}.bind(win)); | |
}); | |
} | |
var script = document.createElement("script"); | |
script.textContent = "(" + confirm.toString() + ")();"; | |
document.body.appendChild(script); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment