Skip to content
Permalink
Browse files

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

More Details:
 - #344
  • Loading branch information...
jboesch authored and jeresig committed Apr 23, 2011
1 parent 15ccae9 commit 02ad0aa3b6d3c28494465539976211b6a89cb1e0
Showing with 4 additions and 4 deletions.
  1. +4 −4 src/event.js
@@ -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 );

0 comments on commit 02ad0aa

Please sign in to comment.
You can’t perform that action at this time.