Fixed a bug that was occurring in the packed version of jQuery.
[jquery.git] / src / fx.js
index c708b1a..1028610 100644 (file)
--- a/src/fx.js
+++ b/src/fx.js
@@ -146,19 +146,6 @@ jQuery.fn.extend({
                });
        },
 
-       dequeue: function(type){
-               type = type || "fx";
-
-               return this.each(function(){
-                       var q = queue(this, type);
-
-                       q.shift();
-
-                       if ( q.length )
-                               q[0].apply( this );
-               });
-       },
-
        stop: function(){
                var timers = jQuery.timers;
 
@@ -171,21 +158,31 @@ jQuery.fn.extend({
 
 });
 
-function queue( elem, type, array ) {
+var queue = function( elem, type, array ) {
        if ( !elem )
                return;
 
-       if ( !elem.queue )
-               elem.queue = {};
+       var q = jQuery.data( elem, type + "queue" );
+
+       if ( !q || array )
+               q = jQuery.data( elem, type + "queue", 
+                       array ? jQuery.makeArray(array) : [] );
+
+       return q;
+};
+
+jQuery.fn.dequeue = function(type){
+       type = type || "fx";
 
-       if ( !elem.queue[type] )
-               elem.queue[type] = [];
+       return this.each(function(){
+               var q = queue(this, type);
 
-       if ( array )
-               elem.queue[type] = jQuery.makeArray(array);
+               q.shift();
 
-       return elem.queue[type];
-}
+               if ( q.length )
+                       q[0].apply( this );
+       });
+};
 
 jQuery.extend({