Commit 5267824a authored by jeresig's avatar jeresig

Updated formatting for the change/submit special event logic. Also switched...

Updated formatting for the change/submit special event logic. Also switched the function declarations to statements. Thanks to Garrett for the recommendation.
parent fec02aa5
......@@ -652,7 +652,7 @@ jQuery.each({
// submit delegation
if ( !jQuery.support.submitBubbles ) {
jQuery.event.special.submit = {
jQuery.event.special.submit = {
setup: function( data, namespaces ) {
if ( this.nodeName.toLowerCase() !== "form" ) {
jQuery.event.add(this, "click.specialSubmit", function( e ) {
......@@ -680,16 +680,18 @@ jQuery.event.special.submit = {
jQuery.event.remove( this, "click.specialSubmit" );
jQuery.event.remove( this, "keypress.specialSubmit" );
}
};
};
}
// change delegation, happens here so we have bind.
if ( !jQuery.support.changeBubbles ) {
var formElems = /textarea|input|select/i;
var formElems = /textarea|input|select/i,
changeFilters,
function getVal( elem ) {
getVal = function( elem ) {
var type = elem.type, val = elem.value;
if ( type === "radio" || type === "checkbox" ) {
......@@ -707,9 +709,9 @@ function getVal( elem ) {
}
return val;
}
},
function testChange( e ) {
testChange = function testChange( e ) {
var elem = e.target, data, val;
if ( !formElems.test( elem.nodeName ) || elem.readOnly ) {
......@@ -732,9 +734,9 @@ function testChange( e ) {
e.type = "change";
return jQuery.event.trigger( e, arguments[1], elem );
}
}
};
jQuery.event.special.change = {
jQuery.event.special.change = {
filters: {
focusout: testChange,
......@@ -782,10 +784,9 @@ jQuery.event.special.change = {
return formElems.test( this.nodeName );
}
};
var changeFilters = jQuery.event.special.change.filters;
};
changeFilters = jQuery.event.special.change.filters;
}
function trigger( type, elem, args ) {
......
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