Skip to content

Commit

Permalink
Merge pull request #145 from benib/ng-drag-handle-without-jquery
Browse files Browse the repository at this point in the history
makes ng-drag-handle work without jQuery
  • Loading branch information
fatlinesofcode committed May 30, 2015
2 parents b4bbf57 + d38ee54 commit 840dd1c
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion ngDraggable.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,13 @@ angular.module("ngDraggable", [])
var initialize = function () {
element.attr('draggable', 'false'); // prevent native drag
// check to see if drag handle(s) was specified
var dragHandles = element.find('[ng-drag-handle]');
// if querySelectorAll is available, we use this instead of find
// as JQLite find is limited to tagnames
if (element[0].querySelectorAll) {
var dragHandles = angular.element(element[0].querySelectorAll('[ng-drag-handle]'));
} else {
var dragHandles = element.find('[ng-drag-handle]');
}
if (dragHandles.length) {
_dragHandle = dragHandles;
}
Expand Down

0 comments on commit 840dd1c

Please sign in to comment.