Skip to content

Commit

Permalink
Merge pull request #132 from makeitdoit/master
Browse files Browse the repository at this point in the history
brought back the 'isClickableElement' check on drag to make ng-cancel-dr...
  • Loading branch information
fatlinesofcode committed Apr 17, 2015
2 parents b444c77 + 859851a commit 768cd51
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion ngDraggable.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ angular.module("ngDraggable", [])
_dragHandle.on(_pressEvents, onpress);
} else {
// no handle(s) specified, use the element as the handle
element.on(_pressEvents, onpress);
element.on(_pressEvents, onpress);
}
if(! _hasTouch && element[0].nodeName.toLowerCase() == "img"){
element.on('mousedown', function(){ return false;}); // prevent native drag for images
Expand Down Expand Up @@ -98,6 +98,10 @@ angular.module("ngDraggable", [])
var onpress = function(evt) {
if(! _dragEnabled)return;

if (isClickableElement(evt)) {
return;
}

if(_hasTouch){
cancelPress();
_pressTimer = setTimeout(function(){
Expand Down

0 comments on commit 768cd51

Please sign in to comment.