Skip to content
This repository was archived by the owner on Sep 8, 2020. It is now read-only.

Better Placeholder Detection #63

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions src/sortable.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ angular.module('ui.sortable', [])
if (placeholder && placeholder.element) {
savedNodes = savedNodes.not(element.find(
"." + placeholder.element()
.attr('class').split(/\s+/).join('.')));
.attr('class').split(/\s+/).join('.') + ':not(.ng-scope)'));
}
};

Expand Down Expand Up @@ -120,7 +120,10 @@ angular.module('ui.sortable', [])
// If the received flag hasn't be set on the item, this is a
// normal sort, if dropindex is set, the item was moved, so move
// the items in the list.
if(!ui.item.sortable.received && ('dropindex' in ui.item.sortable) && !ui.item.sortable.isCanceled()) {
if(!ui.item.sortable.received &&
('dropindex' in ui.item.sortable) &&
!ui.item.sortable.isCanceled()) {

scope.$apply(function () {
ngModel.$modelValue.splice(
ui.item.sortable.dropindex, 0,
Expand Down