Skip to content

Commit

Permalink
Don't try to restore values which weren't saved.
Browse files Browse the repository at this point in the history
For example, this fixes the removal of a valid positioning that was before
calling fadeIn(ms).
  • Loading branch information
romanbsd committed Mar 17, 2014
1 parent 8e53823 commit e572c6c
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions scripts/src/jquery.animate-enhanced.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ Changelog:
0.99 (5/12/2012):
- PR #109 Added support for list-item nodes. FadeIn on tags was omitting the list-style support. (thx @SeanCannon)
0.98 (12/11/2012):
- Merging pull request #106 thx @gboysko - checking for ownerDocument before using getComputedStyle
Expand All @@ -89,7 +89,7 @@ Changelog:
0.96 (20/08/2012):
- Fixes for context, all elements returned as context (issue #84)
- Reset position with leaveTransforms !== true fixes (issue #93)
0.95 (20/08/2012):
- If target opacity == current opacity, pass back to jquery native to get callback firing (#94)
Expand Down Expand Up @@ -328,7 +328,7 @@ Changelog:
// this is a nasty fix, but we check for prop == 'd' to see if we're dealing with SVG, and abort
if (prop == "d") return;
if (!_isValidElement(e)) return;

var parts = rfxnum.exec(val),
start = e.css(prop) === 'auto' ? 0 : e.css(prop),
cleanCSSStart = typeof start == 'string' ? _cleanValue(start) : start,
Expand Down Expand Up @@ -609,8 +609,8 @@ Changelog:
toggle3DByDefault: function() {
return use3DByDefault = !use3DByDefault;
},


/**
@public
@name toggleDisabledByDefault
Expand Down Expand Up @@ -719,8 +719,11 @@ Changelog:
}
if (isTranslatable && typeof selfCSSData.meta !== 'undefined') {
for (var j = 0, dir; (dir = directions[j]); ++j) {
restore[dir] = selfCSSData.meta[dir + '_o'] + valUnit;
jQuery(this).css(dir, restore[dir]);
var stashedProperty = selfCSSData.meta[dir + '_o'];
if (stashedProperty) {
restore[dir] = stashedProperty + valUnit;
jQuery(this).css(dir, restore[dir]);
}
}
}
}
Expand Down

0 comments on commit e572c6c

Please sign in to comment.