Improve HTML5 window.onClose handling for cancelable close
This commit is contained in:
@@ -367,8 +367,18 @@ class HTML5Application {
|
|||||||
|
|
||||||
case "beforeunload":
|
case "beforeunload":
|
||||||
|
|
||||||
|
if (!event.defaultPrevented) {
|
||||||
|
|
||||||
parent.window.onClose.dispatch ();
|
parent.window.onClose.dispatch ();
|
||||||
|
|
||||||
|
if (parent.window.onClose.canceled) {
|
||||||
|
|
||||||
|
event.preventDefault ();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user