From: michaelmwu Date: Sat, 5 Mar 2011 06:17:30 +0000 (-0800) Subject: Sortable: Changed floating calculation to determine also whether items are being... X-Git-Tag: 1.9m5~235^2~6 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=4ad513b7f0b508c03b94066beb95b171a05043f1;p=jquery-ui.git 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) --- diff --git a/ui/jquery.ui.sortable.js b/ui/jquery.ui.sortable.js index 05cbf2132..8356eeb9f 100644 --- a/ui/jquery.ui.sortable.js +++ b/ui/jquery.ui.sortable.js @@ -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();