diff options
author | Dave Methvin <dave.methvin@gmail.com> | 2012-11-24 16:03:57 -0500 |
---|---|---|
committer | Dave Methvin <dave.methvin@gmail.com> | 2012-11-24 16:05:20 -0500 |
commit | 3fce79484434298fb6ad16030674c14b9600b22e (patch) | |
tree | 2fdef6a2997ef78d034683d357bb270db201df6f /src/event.js | |
parent | 6b00b3cad94e348c0ba31c196aaac9fbf819fea3 (diff) | |
download | jquery-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.js | 5 |
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]; |