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

Method endDrag

src/pages/quickTools/quickTools.js:351–372  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

349 }
350
351 endDrag() {
352 const { el, ghost, dropTarget, type, index } = this.dragState;
353
354 this.cleanupHighlight();
355 el.classList.remove("dragging");
356 ghost.remove();
357 this.dragState = null;
358
359 if (dropTarget) {
360 const targetIndex = Number.parseInt(dropTarget.dataset.index, 10);
361
362 if (type === "active") {
363 // Swap within active
364 if (targetIndex !== index) {
365 this.swapItems(index, targetIndex);
366 }
367 } else if (type === "source") {
368 // Replace active slot with source item
369 this.replaceItem(targetIndex, index);
370 }
371 }
372 }
373
374 swapItems(srcIndex, destIndex) {
375 const temp = settings.value.quicktoolsItems[srcIndex];

Callers 2

handleTouchEndMethod · 0.95
upHandlerMethod · 0.95

Calls 4

cleanupHighlightMethod · 0.95
swapItemsMethod · 0.95
replaceItemMethod · 0.95
removeMethod · 0.45

Tested by

no test coverage detected