fatlinesofcode / ngDraggable

Drag and drop module for Angular JS
MIT License
631 stars 400 forks source link

Ng-Drag-Clone Not appearing in proper position #244

Open anupkumarsharma opened 8 years ago

anupkumarsharma commented 8 years ago

Hi, I am using the ng-draggable library on ui-modal window. I am using the clone as below.

I noticed when the drag starts, the new clone element appears on some offset and not exactly overlapping the element. I looked into code and changed the following code in function onmove()

_tx = _mx - _mrx - _dragOffset.left-230; ty = _my - _mry - _dragOffset.top-30;

After the code change its working fine. Not sure the only code which seems likely to be the rootcause can be modal window. like $window.pageXOffset may be returning wrong offset. Also It would be nice to add an additional offsets property to library, incase user want to display the clone some where else. Like imagine a switch which moves element in different divs.

sathishkumar1911 commented 8 years ago

Fixed in https://github.com/fatlinesofcode/ngDraggable/pull/246/commits/2deb92d88411b31d9ed1beb1cc56316dbbcaf4c3. Waiting for merge.