summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsimon <vesspa0330@gmail.com>2025-07-16 15:54:02 -0400
committersimon <vesspa0330@gmail.com>2025-07-16 15:54:02 -0400
commitb9cd6f0712789b868b6c381ac751b414eb7692b9 (patch)
tree1ea741b7e2132efe2b232525a9dbd8762b81ba07
parent50e704a60ddc524b46b1a6e6208446888d79b287 (diff)
up/down good; battling "to top"
-rw-r--r--startpage.html6
1 files changed, 3 insertions, 3 deletions
diff --git a/startpage.html b/startpage.html
index c1b9215..fd5b3b3 100644
--- a/startpage.html
+++ b/startpage.html
@@ -2031,7 +2031,6 @@
// for up/down, simply swap container element z-indexes + save to map
if (direction == "up" || direction == "down") {
// swap z-index of element in destination index to current
- // document.getElementById(zIndexMap.get(destinationIndex)).style.zIndex = currentIndex;
document.getElementById(zIndexMap.get(destinationIndex)).style.zIndex = currentIndex;
document.getElementById(containerId).style.zIndex = destinationIndex;
@@ -2049,10 +2048,11 @@
// for big jumps, we don't just swap z-indexes
else if (direction == "top") {
// moved container is now at top, so we need to ripple all other zIndexes down 1
- for (let i = numberTotalContainers - 1; i > 0; i--) {
-
+ for (let i = 1; i < numberTotalContainers; i++) {
document.getElementById(zIndexMap.get(String(i))).style.zIndex--;
containerDataMap.get(zIndexMap.get(String(i))).containerSettings.zIndex--;
+
+ zIndexMap.set(String(i), zIndexMap.get(String(i+1)))
}
}
else if (direction == "bottom") {