Skip to content

Commit

Permalink
Merge pull request #110 from ryantehbaker/master
Browse files Browse the repository at this point in the history
fixes #108
  • Loading branch information
fatlinesofcode committed Mar 31, 2015
2 parents bb0b719 + d401b30 commit 51fd11f
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions ngDraggable.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,11 +98,6 @@ angular.module("ngDraggable", [])
var onpress = function(evt) {
if(! _dragEnabled)return;

// disable drag on clickable element
if (isClickableElement(evt)) {
return;
}

if(_hasTouch){
cancelPress();
_pressTimer = setTimeout(function(){
Expand All @@ -126,7 +121,6 @@ angular.module("ngDraggable", [])
var onlongpress = function(evt) {
if(! _dragEnabled)return;
evt.preventDefault();
element.addClass('dragging');

offset = element[0].getBoundingClientRect();
if(allowTransform)
Expand Down Expand Up @@ -160,13 +154,17 @@ angular.module("ngDraggable", [])
_deregisterRootMoveListener = $rootScope.$on('draggable:_triggerHandlerMove', function(event, origEvent) {
onmove(origEvent);
});
$rootScope.$broadcast('draggable:start', {x:_mx, y:_my, tx:_tx, ty:_ty, event:evt, element:element, data:_data});
};

var onmove = function (evt) {
if (!_dragEnabled)return;
evt.preventDefault();

if (!element.hasClass('dragging')) {
element.addClass('dragging');
$rootScope.$broadcast('draggable:start', {x:_mx, y:_my, tx:_tx, ty:_ty, event:evt, element:element, data:_data});
}

_mx = ngDraggable.inputEvent(evt).pageX;//ngDraggable.getEventProp(evt, 'pageX');
_my = ngDraggable.inputEvent(evt).pageY;//ngDraggable.getEventProp(evt, 'pageY');

Expand Down

0 comments on commit 51fd11f

Please sign in to comment.