aboutsummaryrefslogtreecommitdiffstats
path: root/src/event.js
diff options
context:
space:
mode:
authorRick Waldon <rick@bocoup.com>2011-04-11 11:32:23 -0400
committerRick Waldon <rick@bocoup.com>2011-04-11 11:32:23 -0400
commit868e1e28ce7cee543e0e47ec2261b44c4c686f99 (patch)
tree5ead38967c58e2f035fa366826c6e22b816c6d92 /src/event.js
parent6591f6dd9d1c86144903f60e5d19e624c5bf6751 (diff)
downloadjquery-868e1e28ce7cee543e0e47ec2261b44c4c686f99.tar.gz
jquery-868e1e28ce7cee543e0e47ec2261b44c4c686f99.zip
Ticket #8753 Always set event type explicitly
Diffstat (limited to 'src/event.js')
-rw-r--r--src/event.js7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/event.js b/src/event.js
index ac0da6b7e..249e81ff6 100644
--- a/src/event.js
+++ b/src/event.js
@@ -304,7 +304,7 @@ jQuery.event = {
}
event.namespace = namespaces.join(".");
event.namespace_re = new RegExp("(^|\\.)" + namespaces.join("\\.(?:.*\\.)?") + "(\\.|$)");
-
+
// Handle a global trigger
if ( !elem ) {
// Don't bubble custom events when global (to avoid too much overhead)
@@ -574,6 +574,9 @@ jQuery.Event = function( src ) {
}
}
+ // Always ensure a type has been explicitly set
+ this.type = src.type;
+
// Events bubbling up the document may have been marked as prevented
// by a handler lower down the tree; reflect the correct value.
this.isDefaultPrevented = (src.defaultPrevented || src.returnValue === false ||
@@ -1033,7 +1036,7 @@ jQuery.each(["live", "die"], function( i, name ) {
if ( data === false || jQuery.isFunction( data ) ) {
fn = data || returnFalse;
data = undefined;
- }
+ }
types = (types || "").split(" ");