Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 13 additions & 3 deletions ngDraggable.js
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,17 @@ angular.module("ngDraggable", [])
_ty = _my - _mry - _dragOffset.top;
}

moveElement(_tx, _ty);
if(allowTransform)
moveElement(_tx, _ty);
else{
//Note: does not take into account _centerAnchor
//Click offset in element coordinates
var ty = _mry - _dragOffset.top;
var tx = _mrx - _dragOffset.left;
var newX = ngDraggable.inputEvent(evt).clientX - tx;
var newY = ngDraggable.inputEvent(evt).clientY - ty;
moveElement(newX, newY);
}

$rootScope.$broadcast('draggable:move', { x: _mx, y: _my, tx: _tx, ty: _ty, event: evt, element: element, data: _data, uid: _myid, dragOffset: _dragOffset });
};
Expand Down Expand Up @@ -254,7 +264,7 @@ angular.module("ngDraggable", [])
'-ms-transform': 'matrix(1, 0, 0, 1, ' + x + ', ' + y + ')'
});
}else{
element.css({'left':x+'px','top':y+'px', 'position':'fixed'});
element.css({'left': x+'px','top': y+'px', 'position': 'fixed', 'z-index': 99999});
}
};
initialize();
Expand Down Expand Up @@ -393,7 +403,7 @@ angular.module("ngDraggable", [])
return {
restrict: 'A',
link: function (scope, element, attrs) {
var img, _allowClone=true;
var img, _allowClone=true, _tx, _ty;
var _dragOffset = null;
scope.clonedData = {};
var initialize = function () {
Expand Down