fix: prevent stacked reorder mode from multiple 'Neu anordnen' clicks
Added _reorderCtx.active flag — plReorderEnter bails early if already active, preventing duplicate handles and event listeners from stacking. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
1 parent
92edaa9da4
commit
96e3cb0451
1 file changed
+3
-1
+3
-1
@@ -587,7 +587,8 @@ function _setupReorderMode(container, songs, pl) {
|
||||
}
|
||||
|
||||
export function plReorderEnter() {
|
||||
if (!_reorderCtx) return;
|
||||
if (!_reorderCtx || _reorderCtx.active) return;
|
||||
_reorderCtx.active = true;
|
||||
const { container, songs } = _reorderCtx;
|
||||
container.classList.add('pl-draggable');
|
||||
// Block context-menu (long-press) on all items while reordering.
|
||||
@@ -684,6 +685,7 @@ export function plReorderCancel() { _exitReorderMode(false); }
|
||||
function _exitReorderMode(save) {
|
||||
if (!_reorderCtx) return;
|
||||
const { container, songs, pl } = _reorderCtx;
|
||||
_reorderCtx.active = false;
|
||||
container.classList.remove('pl-draggable');
|
||||
container.removeEventListener('contextmenu', _blockCtxMenu, true);
|
||||
container.querySelectorAll('.pl-drag-handle').forEach(h => h.remove());
|
||||
|
||||
Reference in new issue
Block a user