diff options
author | Kris Borchers <kris.borchers@gmail.com> | 2013-10-30 00:00:18 -0500 |
---|---|---|
committer | Kris Borchers <kris.borchers@gmail.com> | 2013-11-01 15:17:05 -0500 |
commit | 601ad962e0a417bb369378ed7704a0b493eac365 (patch) | |
tree | 8e5616798d12831701a1f8ca442c3dc2a2bb3d20 /tests | |
parent | 61d16ec939c11f63419cae5bc2aa990134f6c0ff (diff) | |
download | jquery-ui-601ad962e0a417bb369378ed7704a0b493eac365.tar.gz jquery-ui-601ad962e0a417bb369378ed7704a0b493eac365.zip |
Sortable: Adjust itemWithLeastDistance algorithm in _contactContainers to properly handle dragging items to the beginning and ends of lists. Fixes #9314 - Sortable: Items cannot be dragged directly into bottom position. Fixes #9381 - Sortable: Connected list placeholders have an inaccurate initial position
Diffstat (limited to 'tests')
-rw-r--r-- | tests/unit/sortable/sortable.html | 12 | ||||
-rw-r--r-- | tests/unit/sortable/sortable_core.js | 18 |
2 files changed, 27 insertions, 3 deletions
diff --git a/tests/unit/sortable/sortable.html b/tests/unit/sortable/sortable.html index 8e0bac501..b03c786e1 100644 --- a/tests/unit/sortable/sortable.html +++ b/tests/unit/sortable/sortable.html @@ -38,7 +38,7 @@ margin: 1px; border-width: 0; } - #sortable li{ + #sortable li, #sortable2 li{ padding: 0; margin: 0; border-width: 0; @@ -58,7 +58,15 @@ <ol id="qunit-tests"></ol> <div id="qunit-fixture"> -<ul id="sortable"> +<ul id="sortable" class="connectWith"> + <li>Item 1</li> + <li>Item 2</li> + <li>Item 3</li> + <li>Item 4</li> + <li>Item 5</li> +</ul> + +<ul id="sortable2" class="connectWith"> <li>Item 1</li> <li>Item 2</li> <li>Item 3</li> diff --git a/tests/unit/sortable/sortable_core.js b/tests/unit/sortable/sortable_core.js index 211f8ac95..18e7dae08 100644 --- a/tests/unit/sortable/sortable_core.js +++ b/tests/unit/sortable/sortable_core.js @@ -1,3 +1,19 @@ /* * sortable_core.js - */
\ No newline at end of file + */ + +(function( $ ) { + +module( "sortable: core" ); + +test( "#9314: Sortable: Items cannot be dragged directly into bottom position", function() { + expect( 1 ); + + var el = $( ".connectWith" ).sortable({ + connectWith: ".connectWith" + }); + + TestHelpers.sortable.sort( $( "li", el[ 1 ] )[ 0 ], 0, -12, 5, "Dragging the sortable into connected sortable" ); +}); + +})( jQuery ); |