Skip to content

Commit

Permalink
Fix ngDragClone when the page scrolls
Browse files Browse the repository at this point in the history
- Fix the position of the ngDragClone element when the page is scrolled.
  • Loading branch information
rustico committed Jun 22, 2015
1 parent 31bb08b commit bb2130a
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions ngDraggable.js
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ angular.module("ngDraggable", [])

moveElement(_tx, _ty);

$rootScope.$broadcast('draggable:move', { x: _mx, y: _my, tx: _tx, ty: _ty, event: evt, element: element, data: _data, uid: _myid });
$rootScope.$broadcast('draggable:move', { x: _mx, y: _my, tx: _tx, ty: _ty, event: evt, element: element, data: _data, uid: _myid, dragOffset: _dragOffset });
};

var onrelease = function(evt) {
Expand Down Expand Up @@ -421,13 +421,12 @@ angular.module("ngDraggable", [])
moveElement(obj.tx, obj.ty);
}

_dragOffset = element[0].getBoundingClientRect();//ngDraggable.getPrivOffset(element);
};
var onDragMove = function(evt, obj) {
if(_allowClone) {

_tx = obj.tx + _dragOffset.left;
_ty = obj.ty + _dragOffset.top;
_tx = obj.tx + obj.dragOffset.left;
_ty = obj.ty + obj.dragOffset.top;

moveElement(_tx, _ty);
}
Expand Down

1 comment on commit bb2130a

@Krishna9331
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@fatlinesofcode @rustico this change is not yet tagged to bower. please do it ASAP so that we can use it

Please sign in to comment.