diff options
author | tomykaira <tomykaira@gmail.com> | 2011-06-09 20:36:48 -0500 |
---|---|---|
committer | gnarf <gnarf@gnarf.net> | 2011-06-09 20:38:09 -0500 |
commit | 2c8151848d191ad9ba53c0ee86b14aefe4288f67 (patch) | |
tree | 43e306d0a16a06772f9b6616e18b539a09de13e3 /tests | |
parent | 19dcac2129a2b39a24989835c1c732fa630bdefd (diff) | |
download | jquery-ui-2c8151848d191ad9ba53c0ee86b14aefe4288f67.tar.gz jquery-ui-2c8151848d191ad9ba53c0ee86b14aefe4288f67.zip |
effects.core: Convert elements height/width to px and restore after animation in all effects. Fixed #5245 - Relative width elements break when wrapped for effects
Diffstat (limited to 'tests')
-rw-r--r-- | tests/unit/effects/effects.html | 11 | ||||
-rw-r--r-- | tests/unit/effects/effects_core.js | 15 |
2 files changed, 26 insertions, 0 deletions
diff --git a/tests/unit/effects/effects.html b/tests/unit/effects/effects.html index 84fecd9cc..6956ebcda 100644 --- a/tests/unit/effects/effects.html +++ b/tests/unit/effects/effects.html @@ -54,6 +54,14 @@ .testChildren h2 { font-size: 20px; } + + .relWidth { + width: 50%; + } + + .relHeight { + height: 50%; + } </style> </head> <body> @@ -70,6 +78,9 @@ <div class="animateClass test"> <h2>Child Element Test</h2> </div> + <div class="relWidth relHeight testAddBorder"> + <h2>Slide with relative width</d2> + </div> </div> </body> diff --git a/tests/unit/effects/effects_core.js b/tests/unit/effects/effects_core.js index ed9fbf9ba..4c685ebb6 100644 --- a/tests/unit/effects/effects_core.js +++ b/tests/unit/effects/effects_core.js @@ -54,6 +54,21 @@ $.each( $.effects.effect, function( effect ) { start(); })); }); + + asyncTest( "relative width & height - properties are preserved", function() { + var test = $("div.relWidth.relHeight"), + width = test.width(), height = test.height(), + cssWidth = test[0].style.width, cssHeight = test[0].style.height; + + expect( 4 ); + test.toggle( effect, minDuration, function() { + equal( test[0].style.width, cssWidth, "Inline CSS Width has been reset after animation ended" ); + equal( test[0].style.height, cssHeight, "Inline CSS Height has been rest after animation ended" ); + start(); + }); + equal( test.width(), width, "Width is the same px after animation started" ); + equal( test.height(), height, "Height is the same px after animation started" ); + }); }); module("animateClass"); |