()
| 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]; |
no test coverage detected