diff options
author | jeresig <jeresig@gmail.com> | 2011-01-21 09:24:09 -0500 |
---|---|---|
committer | jeresig <jeresig@gmail.com> | 2011-01-21 09:24:09 -0500 |
commit | 328a86f9a0d3f0907cc950f7543e34cb3efbda3f (patch) | |
tree | d272539e7843566af6009faa22727c596a0a52e2 /src/event.js | |
parent | dc2e7317a90464e729fd9f29afaa16fa9c01487c (diff) | |
download | jquery-328a86f9a0d3f0907cc950f7543e34cb3efbda3f.tar.gz jquery-328a86f9a0d3f0907cc950f7543e34cb3efbda3f.zip |
Revert "Make sure that focusin/focusout bubbles in non-IE browsers." This was causing problems with the focusin event, see: #7340.
This reverts commit 88068f82c199847d3679b130664dd91cc2e89f00.
Conflicts:
src/event.js
test/unit/event.js
Diffstat (limited to 'src/event.js')
-rw-r--r-- | src/event.js | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/src/event.js b/src/event.js index 2ddf28812..2d53562ad 100644 --- a/src/event.js +++ b/src/event.js @@ -8,7 +8,6 @@ var rnamespaces = /\.(.*)$/, fcleanup = function( nm ) { return nm.replace(rescape, "\\$&"); }, - focusCounts = { focusin: 0, focusout: 0 }, eventKey = "events"; /* @@ -880,21 +879,17 @@ if ( document.addEventListener ) { jQuery.each({ focus: "focusin", blur: "focusout" }, function( orig, fix ) { jQuery.event.special[ fix ] = { setup: function() { - if ( focusCounts[fix]++ === 0 ) { - document.addEventListener( orig, handler, true ); - } - }, - teardown: function() { - if ( --focusCounts[fix] === 0 ) { - document.removeEventListener( orig, handler, true ); - } + this.addEventListener( orig, handler, true ); + }, + teardown: function() { + this.removeEventListener( orig, handler, true ); } }; function handler( e ) { e = jQuery.event.fix( e ); e.type = fix; - return jQuery.event.trigger( e, null, e.target ); + return jQuery.event.handle.call( this, e ); } }); } |