diff options
author | Scott González <scott.gonzalez@gmail.com> | 2013-03-07 12:55:00 -0500 |
---|---|---|
committer | Scott González <scott.gonzalez@gmail.com> | 2013-03-07 12:55:00 -0500 |
commit | b9be6bb7ad107fd48b28e31df972b2037c47c2cb (patch) | |
tree | 47ce4f47aaee55bc6deb082b2e6ea189de6b5ad8 /tests | |
parent | ca0b4b8a6c6a687866ea27a992570648e9295721 (diff) | |
download | jquery-ui-b9be6bb7ad107fd48b28e31df972b2037c47c2cb.tar.gz jquery-ui-b9be6bb7ad107fd48b28e31df972b2037c47c2cb.zip |
Sortable: Copy the src of the original item when creating a placeholder from an image. Fixes #5129 - Sortable: Unable to use an image as a placeholder in Firefox.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/unit/sortable/sortable.html | 7 | ||||
-rw-r--r-- | tests/unit/sortable/sortable_options.js | 21 |
2 files changed, 24 insertions, 4 deletions
diff --git a/tests/unit/sortable/sortable.html b/tests/unit/sortable/sortable.html index 6e326a865..5e21a49da 100644 --- a/tests/unit/sortable/sortable.html +++ b/tests/unit/sortable/sortable.html @@ -84,6 +84,13 @@ </tbody> </table> +<div id="sortable-images"> + <img src="../images/jqueryui_32x32.png"> + <img src="../images/jqueryui_32x32.png"> + <img src="../images/jqueryui_32x32.png"> + <img src="../images/jqueryui_32x32.png"> +</div> + </div> </body> </html> diff --git a/tests/unit/sortable/sortable_options.js b/tests/unit/sortable/sortable_options.js index fe50be002..caba0a777 100644 --- a/tests/unit/sortable/sortable_options.js +++ b/tests/unit/sortable/sortable_options.js @@ -5,10 +5,6 @@ module("sortable: options"); -// this is here to make JSHint pass "unused", and we don't want to -// remove the parameter for when we finally implement -$.noop(); - /* test("{ appendTo: 'parent' }, default", function() { ok(false, "missing test - untested code is broken code."); @@ -186,6 +182,23 @@ test("{ placeholder: false }, default", function() { ok(false, "missing test - untested code is broken code."); }); */ + +test( "{ placeholder: false } img", function() { + expect( 3 ); + + var element = $( "#sortable-images" ).sortable({ + start: function( event, ui ) { + equal( ui.placeholder.attr( "src" ), "../images/jqueryui_32x32.png", "placeholder img has correct src" ); + equal( ui.placeholder.height(), 32, "placeholder has correct height" ); + equal( ui.placeholder.width(), 32, "placeholder has correct width" ); + } + }); + + element.find( "img" ).eq( 0 ).simulate( "drag", { + dy: 1 + }); +}); + test( "{ placeholder: String }", function() { expect( 1 ); |