diff options
Diffstat (limited to 'src/event.js')
-rw-r--r-- | src/event.js | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/src/event.js b/src/event.js index 330310fc8..499a30397 100644 --- a/src/event.js +++ b/src/event.js @@ -549,16 +549,11 @@ jQuery.event = { }, beforeunload: { - setup: function( data, namespaces, eventHandle ) { - // We only want to do this special case on windows - if ( jQuery.isWindow( this ) ) { - this.onbeforeunload = eventHandle; - } - }, + postDispatch: function( event ) { - teardown: function( namespaces, eventHandle ) { - if ( this.onbeforeunload === eventHandle ) { - this.onbeforeunload = null; + // Even when returnValue equals to undefined Firefox will still show alert + if ( event.result !== undefined ) { + event.originalEvent.returnValue = event.result; } } } |