aboutsummaryrefslogtreecommitdiffstats
path: root/ui/jquery.effects.core.js
diff options
context:
space:
mode:
authorScott González <scott.gonzalez@gmail.com>2010-12-14 09:02:00 -0500
committerScott González <scott.gonzalez@gmail.com>2010-12-14 09:02:00 -0500
commit6731b0e2d60a16611c25cd248318a4076bd4494d (patch)
tree80636e1c30a78bf9e13647e5819767aefebe9a56 /ui/jquery.effects.core.js
parent208454934439482cdbef8ba67a8557a799d44abb (diff)
downloadjquery-ui-6731b0e2d60a16611c25cd248318a4076bd4494d.tar.gz
jquery-ui-6731b0e2d60a16611c25cd248318a4076bd4494d.zip
Effects: Fixed queueing of class animations. Fixes #6748 - animateClass broken in 1.8.7.
Diffstat (limited to 'ui/jquery.effects.core.js')
-rw-r--r--ui/jquery.effects.core.js64
1 files changed, 31 insertions, 33 deletions
diff --git a/ui/jquery.effects.core.js b/ui/jquery.effects.core.js
index b2151d689..bb88dcf19 100644
--- a/ui/jquery.effects.core.js
+++ b/ui/jquery.effects.core.js
@@ -231,43 +231,41 @@ $.effects.animateClass = function(value, duration, easing, callback) {
easing = null;
}
- return this.each(function() {
- $.queue(this, 'fx', function() {
- var that = $(this),
- originalStyleAttr = that.attr('style') || ' ',
- originalStyle = filterStyles(getElementStyles.call(this)),
- newStyle,
- className = that.attr('className');
+ return this.queue('fx', function() {
+ var that = $(this),
+ originalStyleAttr = that.attr('style') || ' ',
+ originalStyle = filterStyles(getElementStyles.call(this)),
+ newStyle,
+ className = that.attr('className');
+
+ $.each(classAnimationActions, function(i, action) {
+ if (value[action]) {
+ that[action + 'Class'](value[action]);
+ }
+ });
+ newStyle = filterStyles(getElementStyles.call(this));
+ that.attr('className', className);
+ that.animate(styleDifference(originalStyle, newStyle), duration, easing, function() {
$.each(classAnimationActions, function(i, action) {
- if (value[action]) {
- that[action + 'Class'](value[action]);
- }
+ if (value[action]) { that[action + 'Class'](value[action]); }
});
- newStyle = filterStyles(getElementStyles.call(this));
- that.attr('className', className);
-
- that.animate(styleDifference(originalStyle, newStyle), duration, easing, function() {
- $.each(classAnimationActions, function(i, action) {
- if (value[action]) { that[action + 'Class'](value[action]); }
- });
- // work around bug in IE by clearing the cssText before setting it
- if (typeof that.attr('style') == 'object') {
- that.attr('style').cssText = '';
- that.attr('style').cssText = originalStyleAttr;
- } else {
- that.attr('style', originalStyleAttr);
- }
- if (callback) { callback.apply(this, arguments); }
- });
-
- // $.animate adds a function to the end of the queue
- // but we want it at the front
- var queue = $.queue(this),
- anim = queue.splice(queue.length - 1, 1)[0];
- queue.splice(1, 0, anim);
- $.dequeue(this);
+ // work around bug in IE by clearing the cssText before setting it
+ if (typeof that.attr('style') == 'object') {
+ that.attr('style').cssText = '';
+ that.attr('style').cssText = originalStyleAttr;
+ } else {
+ that.attr('style', originalStyleAttr);
+ }
+ if (callback) { callback.apply(this, arguments); }
});
+
+ // $.animate adds a function to the end of the queue
+ // but we want it at the front
+ var queue = $.queue(this),
+ anim = queue.splice(queue.length - 1, 1)[0];
+ queue.splice(1, 0, anim);
+ $.dequeue(this);
});
};