MCPcopy Create free account
hub / github.com/angular-dragdrop/angular-dragdrop / calculateDropOffset

Function calculateDropOffset

draganddrop.js:201–219  ·  view source on GitHub ↗
(e)

Source from the content-addressed store, hash-verified

199 var uiOnDragOverFn = $parse(attr.uiOnDragOver);
200
201 function calculateDropOffset(e) {
202 var offset = {
203 x: e.offsetX,
204 y: e.offsetY
205 };
206 var target = e.target;
207
208 while (target !== element[0]) {
209 offset.x = offset.x + target.offsetLeft;
210 offset.y = offset.y + target.offsetTop;
211
212 target = target.offsetParent;
213 if (!target) {
214 return null;
215 }
216 }
217
218 return offset;
219 }
220
221 function onDragOver(e) {
222 if (e.preventDefault) {

Callers 1

onDropFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected