Merge pull request #549 from tobscure/onunload-context

Fix onunload being called with incorrect context
This commit is contained in:
Leo Horie 2015-04-13 08:27:46 -04:00
commit 5ffd80f5c6

View file

@ -568,7 +568,7 @@ var m = (function app(window, undefined) {
var isPrevented = false;
var event = {preventDefault: function() {isPrevented = true}};
for (var i = 0, unloader; unloader = unloaders[i]; i++) {
unloader.handler(event)
unloader.handler.call(unloader.controller, event)
unloader.controller.onunload = null
}
if (isPrevented) {