Skip to content

Commit

Permalink
fix - placeholder added in wrong place with nested dragster instances (
Browse files Browse the repository at this point in the history
  • Loading branch information
dew326 authored and sunpietro committed Feb 7, 2017
1 parent 13a4d73 commit ccf5344
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions dragster.js
Original file line number Diff line number Diff line change
Expand Up @@ -746,8 +746,11 @@
* @param regionTarget {HTMLElement} a region drop target
*/
addPlaceholderInRegionBelowTargets: function (regionTarget) {
var elementsInRegion = regionTarget.getElementsByClassName(CLASS_DRAGGABLE),
dropTarget = elementsInRegion[elementsInRegion.length - 1],
var elementsInRegion = [].slice.call(regionTarget.getElementsByClassName(CLASS_DRAGGABLE)),
filteredElements = elementsInRegion.filter(function (elementInRegion) {
return elementInRegion.dataset.dragsterId === dragsterId;
}),
dropTarget = filteredElements[filteredElements.length - 1],
placeholder = createPlaceholder();

placeholder.dataset.placeholderPosition = POS_BOTTOM;
Expand Down

0 comments on commit ccf5344

Please sign in to comment.