Landing pull request 344. using jQuery.nodeName where applicable.
More Details: - https://github.com/jquery/jquery/pull/344
This commit is contained in:
parent
15ccae91db
commit
02ad0aa3b6
1 changed files with 4 additions and 4 deletions
|
@ -707,7 +707,7 @@ if ( !jQuery.support.submitBubbles ) {
|
||||||
|
|
||||||
jQuery.event.special.submit = {
|
jQuery.event.special.submit = {
|
||||||
setup: function( data, namespaces ) {
|
setup: function( data, namespaces ) {
|
||||||
if ( this.nodeName && this.nodeName.toLowerCase() !== "form" ) {
|
if ( !jQuery.nodeName( this, "form" ) ) {
|
||||||
jQuery.event.add(this, "click.specialSubmit", function( e ) {
|
jQuery.event.add(this, "click.specialSubmit", function( e ) {
|
||||||
var elem = e.target,
|
var elem = e.target,
|
||||||
type = elem.type;
|
type = elem.type;
|
||||||
|
@ -756,7 +756,7 @@ if ( !jQuery.support.changeBubbles ) {
|
||||||
}).join("-") :
|
}).join("-") :
|
||||||
"";
|
"";
|
||||||
|
|
||||||
} else if ( elem.nodeName.toLowerCase() === "select" ) {
|
} else if ( jQuery.nodeName( elem, "select" ) ) {
|
||||||
val = elem.selectedIndex;
|
val = elem.selectedIndex;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -798,7 +798,7 @@ if ( !jQuery.support.changeBubbles ) {
|
||||||
click: function( e ) {
|
click: function( e ) {
|
||||||
var elem = e.target, type = jQuery.nodeName( elem, "input" ) ? elem.type : "";
|
var elem = e.target, type = jQuery.nodeName( elem, "input" ) ? elem.type : "";
|
||||||
|
|
||||||
if ( type === "radio" || type === "checkbox" || elem.nodeName.toLowerCase() === "select" ) {
|
if ( type === "radio" || type === "checkbox" || jQuery.nodeName( elem, "select" ) ) {
|
||||||
testChange.call( this, e );
|
testChange.call( this, e );
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -808,7 +808,7 @@ if ( !jQuery.support.changeBubbles ) {
|
||||||
keydown: function( e ) {
|
keydown: function( e ) {
|
||||||
var elem = e.target, type = jQuery.nodeName( elem, "input" ) ? elem.type : "";
|
var elem = e.target, type = jQuery.nodeName( elem, "input" ) ? elem.type : "";
|
||||||
|
|
||||||
if ( (e.keyCode === 13 && elem.nodeName.toLowerCase() !== "textarea") ||
|
if ( (e.keyCode === 13 && !jQuery.nodeName( elem, "textarea" ) ) ||
|
||||||
(e.keyCode === 32 && (type === "checkbox" || type === "radio")) ||
|
(e.keyCode === 32 && (type === "checkbox" || type === "radio")) ||
|
||||||
type === "select-multiple" ) {
|
type === "select-multiple" ) {
|
||||||
testChange.call( this, e );
|
testChange.call( this, e );
|
||||||
|
|
Loading…
Reference in a new issue