aboutsummaryrefslogtreecommitdiffstats
path: root/src/event.js
diff options
context:
space:
mode:
authorJohn Resig <jeresig@gmail.com>2010-10-11 18:20:57 -0400
committerJohn Resig <jeresig@gmail.com>2010-10-11 18:20:57 -0400
commit1df5084c9748a8d38516266063344f145bc428c0 (patch)
treede85f575c03abd19e6fdf8f84d14ba461daf71b8 /src/event.js
parentc00a6ff1f14609bb166346a7f0c5174f4b0aa47b (diff)
downloadjquery-1df5084c9748a8d38516266063344f145bc428c0.tar.gz
jquery-1df5084c9748a8d38516266063344f145bc428c0.zip
Handle some edge cases with binding events to the window object (which is also a plain object - causing some confusion). Fixes #7143.
Diffstat (limited to 'src/event.js')
-rw-r--r--src/event.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/event.js b/src/event.js
index 7a10a12cb..d949d0f0f 100644
--- a/src/event.js
+++ b/src/event.js
@@ -282,7 +282,7 @@ jQuery.event = {
delete elemData.handle;
if ( typeof elemData === "function" ) {
- delete elem.events;
+ jQuery.removeData( elem, "events" );
} else if ( jQuery.isEmptyObject( elemData ) ) {
jQuery.removeData( elem );
@@ -346,7 +346,7 @@ jQuery.event = {
// Trigger the event, it is assumed that "handle" is a function
var handle = elem.nodeType ?
jQuery.data( elem, "handle" ) :
- elem.events && elem.events.handle;
+ (jQuery.data( elem, "events" ) || {}).handle;
if ( handle ) {
handle.apply( elem, data );