aboutsummaryrefslogtreecommitdiffstats
path: root/src/event.js
diff options
context:
space:
mode:
authorDave Methvin <dave.methvin@gmail.com>2012-11-24 16:03:57 -0500
committerDave Methvin <dave.methvin@gmail.com>2012-11-24 16:05:20 -0500
commit3fce79484434298fb6ad16030674c14b9600b22e (patch)
tree2fdef6a2997ef78d034683d357bb270db201df6f /src/event.js
parent6b00b3cad94e348c0ba31c196aaac9fbf819fea3 (diff)
downloadjquery-3fce79484434298fb6ad16030674c14b9600b22e.tar.gz
jquery-3fce79484434298fb6ad16030674c14b9600b22e.zip
Fix #12733. Ignore excess spaciness in event strings.
Thanks @bentruyman!
Diffstat (limited to 'src/event.js')
-rw-r--r--src/event.js5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/event.js b/src/event.js
index e92336a91..a40bc0859 100644
--- a/src/event.js
+++ b/src/event.js
@@ -1,5 +1,6 @@
var rformElems = /^(?:textarea|input|select)$/i,
rtypenamespace = /^([^\.]*|)(?:\.(.+)|)$/,
+ reventTypes = /\S+/g,
rkeyEvent = /^key/,
rmouseEvent = /^(?:mouse|contextmenu)|click/,
rfocusMorph = /^(?:focusinfocus|focusoutblur)$/;
@@ -52,7 +53,7 @@ jQuery.event = {
// Handle multiple events separated by a space
// jQuery(...).bind("mouseover mouseout", fn);
- types = jQuery.trim( types ).split( " " );
+ types = (types || "").match( reventTypes ) || [""];
for ( t = 0; t < types.length; t++ ) {
tns = rtypenamespace.exec( types[t] ) || [];
@@ -135,7 +136,7 @@ jQuery.event = {
}
// Once for each type.namespace in types; type may be omitted
- types = jQuery.trim( types ).split(" ");
+ types = (types || "").match( reventTypes ) || [""];
for ( t = 0; t < types.length; t++ ) {
tns = rtypenamespace.exec( types[t] ) || [];
type = origType = tns[1];