Commit 02ad0aa3 authored by Jordan Boesch's avatar Jordan Boesch Committed by John Resig

Landing pull request 344. using jQuery.nodeName where applicable.

More Details:
 - https://github.com/jquery/jquery/pull/344
parent 15ccae91
...@@ -707,7 +707,7 @@ if ( !jQuery.support.submitBubbles ) { ...@@ -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 ) { ...@@ -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 ) { ...@@ -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 ) { ...@@ -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 );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment