Sortable: Changed floating calculation to determine also whether items are being displayed horizontally. Helps fix odd sorting behavior for horizontal lists. Fixed #6702 - horizontal sortable not working (and solution)(cherry picked from commit f1d939bc58)

This commit is contained in:
michaelmwu 2011-03-04 22:17:30 -08:00 committed by Scott González
parent bfb5582435
commit 20b010640e

View File

@ -49,8 +49,8 @@ $.widget("ui.sortable", $.ui.mouse, {
//Get the items
this.refresh();
//Let's determine if the items are floating
this.floating = this.items.length ? (/left|right/).test(this.items[0].item.css('float')) : false;
//Let's determine if the items are being displayed horizontally
this.floating = this.items.length ? (/left|right/).test(this.items[0].item.css('float')) || (/inline|table-cell/).test(this.items[0].item.css('display')) : false;
//Let's determine the parent's offset
this.offset = this.element.offset();