From a6fecaaa443eda3063446b5780c694054be7f6dd Mon Sep 17 00:00:00 2001 From: simon Date: Wed, 16 Jul 2025 11:18:46 -0400 Subject: [PATCH] efficient reordering is fully functional!! :) --- startpage.html | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/startpage.html b/startpage.html index bba145b..1fe9f78 100644 --- a/startpage.html +++ b/startpage.html @@ -1926,6 +1926,10 @@ document.getElementById("containers").insertAdjacentElement("beforeend", clickedListingCopy); } + console.log("current" + currentIndex); + console.log("destination" + destinationIndex); + console.log("zindexmap BEFORE: ", zIndexMap); + let destinationContainer = containerDataMap.get(zIndexMap.get(destinationIndex)); // swap container z-indexes @@ -1933,11 +1937,12 @@ document.getElementById(containerId).style.zIndex = destinationIndex; // save changes to map - zIndexMap.set(currentIndex, zIndexMap.get(destinationIndex)); + zIndexMap.set(String(currentIndex), zIndexMap.get(destinationIndex)); zIndexMap.set(destinationIndex, movingContainer.id); - // save new indexes direcly to affected containers + console.log("zindexmap AFTER: ", zIndexMap); + // save new indexes direcly to affected containers movingContainer.containerSettings.zIndex = destinationIndex; movingContainer.addSettingsMenuEventListeners();