MCPcopy Create free account
hub / github.com/Acode-Foundation/Acode / updateDrag

Method updateDrag

src/pages/quickTools/quickTools.js:325–344  ·  view source on GitHub ↗
(pointer)

Source from the content-addressed store, hash-verified

323 }
324
325 updateDrag(pointer) {
326 const { ghost } = this.dragState;
327 ghost.style.left = pointer.clientX + "px";
328 ghost.style.top = pointer.clientY + "px";
329
330 const elementBelow = document.elementFromPoint(
331 pointer.clientX,
332 pointer.clientY,
333 );
334
335 this.cleanupHighlight();
336
337 const targetItem = elementBelow?.closest(".tool-item");
338 if (targetItem && targetItem.dataset.type === "active") {
339 targetItem.classList.add("highlight-target");
340 this.dragState.dropTarget = targetItem;
341 } else {
342 this.dragState.dropTarget = null;
343 }
344 }
345
346 cleanupHighlight() {
347 const highlighted = this.container.querySelectorAll(".highlight-target");

Callers 3

handleTouchMoveMethod · 0.95
moveHandlerMethod · 0.95
startDragMethod · 0.95

Calls 2

cleanupHighlightMethod · 0.95
addMethod · 0.80

Tested by

no test coverage detected