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

Commit fd750f3

Browse files
committed
Merge pull request #77 from thgreasi/angular1.2
Fix for jquery ui 1.9.x placeholder element detection issue.
2 parents 370b820 + 7304fcb commit fd750f3

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/sortable.js

+8-1
Original file line numberDiff line numberDiff line change
@@ -77,10 +77,17 @@ angular.module('ui.sortable', [])
7777
// placeholder class was given or placeholder.element will be
7878
// undefined if a class was given (placeholder will be a string)
7979
if (placeholder && placeholder.element && typeof placeholder.element === 'function') {
80+
var phElement = placeholder.element();
81+
// workaround for jquery ui 1.9.x,
82+
// not returning jquery collection
83+
if (!phElement.jquery) {
84+
phElement = $(phElement);
85+
}
86+
8087
// exact match with the placeholder's class attribute to handle
8188
// the case that multiple connected sortables exist and
8289
// the placehoilder option equals the class of sortable items
83-
var excludes = element.find('[class="' + placeholder.element().attr('class') + '"]');
90+
var excludes = element.find('[class="' + phElement.attr('class') + '"]');
8491

8592
savedNodes = savedNodes.not(excludes);
8693
}

0 commit comments

Comments
 (0)