]> source.dussan.org Git - jquery.git/commitdiff
Landing pull request 344. using jQuery.nodeName where applicable.
authorJordan Boesch <jboesch26@gmail.com>
Sat, 23 Apr 2011 21:58:56 +0000 (17:58 -0400)
committerJohn Resig <jeresig@gmail.com>
Sat, 23 Apr 2011 21:58:56 +0000 (17:58 -0400)
More Details:
 - https://github.com/jquery/jquery/pull/344

src/event.js

index d20c6f2d0854ee495af70ed021fd5c1f00ecc193..0f09241c9810eda14f29fbb9686d234b9da44840 100644 (file)
@@ -707,7 +707,7 @@ if ( !jQuery.support.submitBubbles ) {
 
        jQuery.event.special.submit = {
                setup: function( data, namespaces ) {
-                       if ( this.nodeName && this.nodeName.toLowerCase() !== "form" ) {
+                       if ( !jQuery.nodeName( this, "form" ) ) {
                                jQuery.event.add(this, "click.specialSubmit", function( e ) {
                                        var elem = e.target,
                                                type = elem.type;
@@ -756,7 +756,7 @@ if ( !jQuery.support.changeBubbles ) {
                                }).join("-") :
                                "";
 
-               } else if ( elem.nodeName.toLowerCase() === "select" ) {
+               } else if ( jQuery.nodeName( elem, "select" ) ) {
                        val = elem.selectedIndex;
                }
 
@@ -798,7 +798,7 @@ if ( !jQuery.support.changeBubbles ) {
                        click: function( e ) {
                                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 );
                                }
                        },
@@ -808,7 +808,7 @@ if ( !jQuery.support.changeBubbles ) {
                        keydown: function( e ) {
                                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")) ||
                                        type === "select-multiple" ) {
                                        testChange.call( this, e );