aboutsummaryrefslogtreecommitdiffstats
path: root/ui/jquery.ui.effect.js
diff options
context:
space:
mode:
authorScott González <scott.gonzalez@gmail.com>2012-07-10 09:00:26 -0400
committerScott González <scott.gonzalez@gmail.com>2012-07-10 09:00:26 -0400
commit3a7c1bc07a025cb538d2f8b77fb32362a18ee1f0 (patch)
treef4637da3cf9a88e764c9eaaa41e89eade6d4923b /ui/jquery.ui.effect.js
parent2ed34e4f1f9ec8423989d4e9bd7dbada41322cd5 (diff)
downloadjquery-ui-3a7c1bc07a025cb538d2f8b77fb32362a18ee1f0.tar.gz
jquery-ui-3a7c1bc07a025cb538d2f8b77fb32362a18ee1f0.zip
Effects: Work around jQuery 1.6.2 returning undefined for falsy values in .data().
Diffstat (limited to 'ui/jquery.ui.effect.js')
-rw-r--r--ui/jquery.ui.effect.js14
1 files changed, 12 insertions, 2 deletions
diff --git a/ui/jquery.ui.effect.js b/ui/jquery.ui.effect.js
index 93e85ebfd..7cabe5849 100644
--- a/ui/jquery.ui.effect.js
+++ b/ui/jquery.ui.effect.js
@@ -861,9 +861,19 @@ $.extend( $.effects, {
// Restores a set of previously saved properties from a data storage
restore: function( element, set ) {
- for( var i=0; i < set.length; i++ ) {
+ var val, i;
+ for( i=0; i < set.length; i++ ) {
if ( set[ i ] !== null ) {
- element.css( set[ i ], element.data( dataSpace + set[ i ] ) );
+ val = element.data( dataSpace + set[ i ] );
+ // support: jQuery 1.6.2
+ // http://bugs.jquery.com/ticket/9917
+ // jQuery 1.6.2 incorrectly returns undefined for any falsy value.
+ // We can't differentiate between "" and 0 here, so we just assume
+ // empty string since it's likely to be a more common value...
+ if ( val === undefined ) {
+ val = "";
+ }
+ element.css( set[ i ], val );
}
}
},