diff options
author | Karl Swedberg <karl@englishrules.com> | 2009-11-28 03:28:42 +0800 |
---|---|---|
committer | John Resig <jeresig@gmail.com> | 2009-11-28 04:09:14 +0800 |
commit | ddb86f8d5bd1bd21b2beeeea55baf505b47dfed5 (patch) | |
tree | c52314e46719d2b4fa9969fbebd1bd711c7d59ab /src/data.js | |
parent | 1879e8cbeef6984495ee84f482900defda0dc3f4 (diff) | |
download | jquery-ddb86f8d5bd1bd21b2beeeea55baf505b47dfed5.tar.gz jquery-ddb86f8d5bd1bd21b2beeeea55baf505b47dfed5.zip |
added curly braces around all if/else statements
Diffstat (limited to 'src/data.js')
-rw-r--r-- | src/data.js | 34 |
1 files changed, 18 insertions, 16 deletions
diff --git a/src/data.js b/src/data.js index 8fa62dc1e..f4dad1636 100644 --- a/src/data.js +++ b/src/data.js @@ -80,19 +80,19 @@ jQuery.extend({ }, queue: function( elem, type, data ) { - if( !elem ) return; + if ( !elem ) { return; } type = (type || "fx") + "queue"; var q = jQuery.data( elem, type ); // Speed up dequeue by getting out quickly if this is just a lookup - if( !data ) return q || []; + if ( !data ) { return q || []; } - if ( !q || jQuery.isArray(data) ) + if ( !q || jQuery.isArray(data) ) { q = jQuery.data( elem, type, jQuery.makeArray(data) ); - else + } else { q.push( data ); - + } return q; }, @@ -102,12 +102,12 @@ jQuery.extend({ var queue = jQuery.queue( elem, type ), fn = queue.shift(); // If the fx queue is dequeued, always remove the progress sentinel - if( fn === "inprogress" ) fn = queue.shift(); + if ( fn === "inprogress" ) { fn = queue.shift(); } - if( fn ) { + if ( fn ) { // Add a progress sentinel to prevent the fx queue from being // automatically dequeued - if( type == "fx" ) queue.unshift("inprogress"); + if ( type == "fx" ) { queue.unshift("inprogress"); } fn.call(elem, function() { jQuery.dequeue(elem, type); }); } @@ -126,16 +126,17 @@ jQuery.fn.extend({ if ( value === undefined ) { var data = this.triggerHandler("getData" + parts[1] + "!", [parts[0]]); - if ( data === undefined && this.length ) + if ( data === undefined && this.length ) { data = jQuery.data( this[0], key ); - + } return data === undefined && parts[1] ? this.data( parts[0] ) : data; - } else + } else { return this.trigger("setData" + parts[1] + "!", [parts[0], value]).each(function(){ jQuery.data( this, key, value ); }); + } }, removeData: function( key ){ @@ -149,19 +150,20 @@ jQuery.fn.extend({ type = "fx"; } - if ( data === undefined ) + if ( data === undefined ) { return jQuery.queue( this[0], type ); - + } return this.each(function(i, elem){ var queue = jQuery.queue( this, type, data ); - if( type == "fx" && queue[0] !== "inprogress" ) - jQuery.dequeue( this, type ) + if ( type == "fx" && queue[0] !== "inprogress" ) { + jQuery.dequeue( this, type ); + } }); }, dequeue: function(type){ return this.each(function(){ - jQuery.dequeue( this, type ); + jQuery.dequeue( this, type ) }); }, clearQueue: function(type){ |