From: Matt Hoskins Date: Mon, 14 Mar 2011 13:53:00 +0000 (-0700) Subject: Draggable: Calling .refreshPositions instead of ._refreshItems when dragging with... X-Git-Tag: 1.9m5~227 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=84257e7f0ae20b81b085f1360c15defdd2b89ea9;p=jquery-ui.git Draggable: Calling .refreshPositions instead of ._refreshItems when dragging with a connected sortable to force containerCache initialisation/update. Fixed: #5563 - connectToSortable misbehaves if the position of the sortable changes after the sortable and draggable have been initialised as _refreshItems no longer updating container cache. --- diff --git a/ui/jquery.ui.draggable.js b/ui/jquery.ui.draggable.js index 304240130..ff1ad1363 100644 --- a/ui/jquery.ui.draggable.js +++ b/ui/jquery.ui.draggable.js @@ -477,7 +477,7 @@ $.ui.plugin.add("draggable", "connectToSortable", { instance: sortable, shouldRevert: sortable.options.revert }); - sortable._refreshItems(); //Do a one-time refresh at start to refresh the containerCache + sortable.refreshPositions(); // Call the sortable's refreshPositions at drag start to refresh the containerCache since the sortable container cache is used in drag and needs to be up to date (this will ensure it's initialised as well as being kept in step with any changes that might have happened on the page). sortable._trigger("activate", event, uiSortable); } });