mirror of
https://github.com/jquery/jquery.git
synced 2024-11-23 02:54:22 +00:00
Fix #12733. Ignore excess spaciness in event strings.
Thanks @bentruyman!
This commit is contained in:
parent
6b00b3cad9
commit
3fce794844
@ -1,5 +1,6 @@
|
|||||||
var rformElems = /^(?:textarea|input|select)$/i,
|
var rformElems = /^(?:textarea|input|select)$/i,
|
||||||
rtypenamespace = /^([^\.]*|)(?:\.(.+)|)$/,
|
rtypenamespace = /^([^\.]*|)(?:\.(.+)|)$/,
|
||||||
|
reventTypes = /\S+/g,
|
||||||
rkeyEvent = /^key/,
|
rkeyEvent = /^key/,
|
||||||
rmouseEvent = /^(?:mouse|contextmenu)|click/,
|
rmouseEvent = /^(?:mouse|contextmenu)|click/,
|
||||||
rfocusMorph = /^(?:focusinfocus|focusoutblur)$/;
|
rfocusMorph = /^(?:focusinfocus|focusoutblur)$/;
|
||||||
@ -52,7 +53,7 @@ jQuery.event = {
|
|||||||
|
|
||||||
// Handle multiple events separated by a space
|
// Handle multiple events separated by a space
|
||||||
// jQuery(...).bind("mouseover mouseout", fn);
|
// jQuery(...).bind("mouseover mouseout", fn);
|
||||||
types = jQuery.trim( types ).split( " " );
|
types = (types || "").match( reventTypes ) || [""];
|
||||||
for ( t = 0; t < types.length; t++ ) {
|
for ( t = 0; t < types.length; t++ ) {
|
||||||
|
|
||||||
tns = rtypenamespace.exec( types[t] ) || [];
|
tns = rtypenamespace.exec( types[t] ) || [];
|
||||||
@ -135,7 +136,7 @@ jQuery.event = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Once for each type.namespace in types; type may be omitted
|
// 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++ ) {
|
for ( t = 0; t < types.length; t++ ) {
|
||||||
tns = rtypenamespace.exec( types[t] ) || [];
|
tns = rtypenamespace.exec( types[t] ) || [];
|
||||||
type = origType = tns[1];
|
type = origType = tns[1];
|
||||||
|
@ -2650,7 +2650,7 @@ test(".on and .off", function() {
|
|||||||
counter += (e.data || 0) + (trig || 1);
|
counter += (e.data || 0) + (trig || 1);
|
||||||
};
|
};
|
||||||
jQuery( "#onandoff" )
|
jQuery( "#onandoff" )
|
||||||
.on( "click clack cluck", "em", 2, mixfn )
|
.on( " click clack cluck ", "em", 2, mixfn )
|
||||||
.on( "cluck", "b", 7, mixfn )
|
.on( "cluck", "b", 7, mixfn )
|
||||||
.on( "cluck", mixfn )
|
.on( "cluck", mixfn )
|
||||||
.trigger( "what!" )
|
.trigger( "what!" )
|
||||||
|
Loading…
Reference in New Issue
Block a user