Merge pull request #3510 from minrk/ffisbroken

use `window.onbeforeunload=` for nav-away warning

Firefox 22 broke `$(window).on("beforeunload")` somehow, for some reason, resulting in always showing a dialog, regardless of the function's return value.

closes #3509

The only fix I could find was resorting to the basic low-level API.
This commit is contained in:
Min RK 2013-07-02 09:51:51 -07:00
commit 7084556f19

View File

@ -350,8 +350,10 @@ var IPython = (function (IPython) {
var time = (extrap != undefined) ? ((extrap.duration != undefined ) ? extrap.duration : 'fast') : 'fast';
expand_time(time);
});
$(window).bind('beforeunload', function () {
// Firefox 22 broke $(window).on("beforeunload")
// I'm not sure why or how.
window.onbeforeunload = function (e) {
// TODO: Make killing the kernel configurable.
var kill_kernel = false;
if (kill_kernel) {
@ -370,7 +372,7 @@ var IPython = (function (IPython) {
// Null is the *only* return value that will make the browser not
// pop up the "don't leave" dialog.
return null;
});
};
};
/**