MCPcopy
hub / github.com/adobe-webplatform/Snap.svg / dragMove

Function dragMove

demos/snap-ad/site/js/main.js:6236–6276  ·  view source on GitHub ↗
(e)

Source from the content-addressed store, hash-verified

6234 })(),
6235 drag = [],
6236 dragMove = function (e) {
6237 var x = e.clientX,
6238 y = e.clientY,
6239 scrollY = getScroll("y"),
6240 scrollX = getScroll("x"),
6241 dragi,
6242 j = drag.length;
6243 while (j--) {
6244 dragi = drag[j];
6245 if (supportsTouch) {
6246 var i = e.touches && e.touches.length,
6247 touch;
6248 while (i--) {
6249 touch = e.touches[i];
6250 if (touch.identifier == dragi.el._drag.id || dragi.el.node.contains(touch.target)) {
6251 x = touch.clientX;
6252 y = touch.clientY;
6253 (e.originalEvent ? e.originalEvent : e).preventDefault();
6254 break;
6255 }
6256 }
6257 } else {
6258 e.preventDefault();
6259 }
6260 var node = dragi.el.node,
6261 o,
6262 glob = Snap._.glob,
6263 next = node.nextSibling,
6264 parent = node.parentNode,
6265 display = node.style.display;
6266 // glob.win.opera && parent.removeChild(node);
6267 // node.style.display = "none";
6268 // o = dragi.el.paper.getElementByPoint(x, y);
6269 // node.style.display = display;
6270 // glob.win.opera && (next ? parent.insertBefore(node, next) : parent.appendChild(node));
6271 // o && eve("snap.drag.over." + dragi.el.id, dragi.el, o);
6272 x += scrollX;
6273 y += scrollY;
6274 eve("snap.drag.move." + dragi.el.id, dragi.move_scope || dragi.el, x - dragi.el._drag.x, y - dragi.el._drag.y, x, y, e);
6275 }
6276 },
6277 dragUp = function (e) {
6278 Snap.unmousemove(dragMove).unmouseup(dragUp);
6279 var i = drag.length,

Callers

nothing calls this directly

Calls 2

getScrollFunction · 0.70
eveFunction · 0.70

Tested by

no test coverage detected