aboutsummaryrefslogtreecommitdiffstats
path: root/src/event
diff options
context:
space:
mode:
authorJohn Resig <jeresig@gmail.com>2007-02-18 22:17:28 +0000
committerJohn Resig <jeresig@gmail.com>2007-02-18 22:17:28 +0000
commit3eaebf45a21f3eceb0144769713353bebb9d44a7 (patch)
treefb20d846249cac812861c121b5a02f8fab14c818 /src/event
parent5616e4c357ec6d793bb20e8ff7b7bd77c995a5d6 (diff)
downloadjquery-3eaebf45a21f3eceb0144769713353bebb9d44a7.tar.gz
jquery-3eaebf45a21f3eceb0144769713353bebb9d44a7.zip
Fix for bug #959, maintaining a list of event handlers on the 'events' property was causing problems with elements whom had that ID.
Diffstat (limited to 'src/event')
-rw-r--r--src/event/event.js24
1 files changed, 12 insertions, 12 deletions
diff --git a/src/event/event.js b/src/event/event.js
index 02bdbe4e3..e7f920f9b 100644
--- a/src/event/event.js
+++ b/src/event/event.js
@@ -22,16 +22,16 @@ jQuery.event = {
handler.guid = this.guid++;
// Init the element's event structure
- if (!element.events)
- element.events = {};
+ if (!element.$events)
+ element.$events = {};
// Get the current list of functions bound to this event
- var handlers = element.events[type];
+ var handlers = element.$events[type];
// If it hasn't been initialized yet
if (!handlers) {
// Init the event handler queue
- handlers = element.events[type] = {};
+ handlers = element.$events[type] = {};
// Remember an existing handler, if it's already there
if (element["on" + type])
@@ -55,17 +55,17 @@ jQuery.event = {
// Detach an event or set of events from an element
remove: function(element, type, handler) {
- if (element.events)
+ if (element.$events)
if ( type && type.type )
- delete element.events[ type.type ][ type.handler.guid ];
- else if (type && element.events[type])
+ delete element.$events[ type.type ][ type.handler.guid ];
+ else if (type && element.$events[type])
if ( handler )
- delete element.events[type][handler.guid];
+ delete element.$events[type][handler.guid];
else
- for ( var i in element.events[type] )
- delete element.events[type][i];
+ for ( var i in element.$events[type] )
+ delete element.$events[type][i];
else
- for ( var j in element.events )
+ for ( var j in element.$events )
this.remove( element, j );
},
@@ -111,7 +111,7 @@ jQuery.event = {
// returned undefined or false
var returnValue;
- var c = this.events[event.type];
+ var c = this.$events[event.type];
var args = [].slice.call( arguments, 1 );
args.unshift( event );