Skip to content

Commit

Permalink
Draggable: Calling .refreshPositions instead of ._refreshItems when d…
Browse files Browse the repository at this point in the history
…ragging 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.(cherry picked from commit 84257e7)
  • Loading branch information
FurLined authored and scottgonzalez committed Mar 14, 2011
1 parent 2d6ad06 commit 6fcdff1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ui/jquery.ui.draggable.js
Expand Up @@ -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);
}
});
Expand Down

0 comments on commit 6fcdff1

Please sign in to comment.