Skip to content

Commit d38ee54

Browse files
author
benib
committed
makes ng-drag-handle work without jQuery
1 parent d1ef32b commit d38ee54

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

ngDraggable.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,13 @@ angular.module("ngDraggable", [])
4545
var initialize = function () {
4646
element.attr('draggable', 'false'); // prevent native drag
4747
// check to see if drag handle(s) was specified
48-
var dragHandles = element.find('[ng-drag-handle]');
48+
// if querySelectorAll is available, we use this instead of find
49+
// as JQLite find is limited to tagnames
50+
if (element[0].querySelectorAll) {
51+
var dragHandles = angular.element(element[0].querySelectorAll('[ng-drag-handle]'));
52+
} else {
53+
var dragHandles = element.find('[ng-drag-handle]');
54+
}
4955
if (dragHandles.length) {
5056
_dragHandle = dragHandles;
5157
}

0 commit comments

Comments
 (0)