Skip to content

Commit

Permalink
🩹 don't shuffle items in cms edit mode
Browse files Browse the repository at this point in the history
makes editing a lot easier
  • Loading branch information
krmax44 committed Sep 30, 2024
1 parent 1378ae5 commit a21644b
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions frontend/javascript/misc/shuffle-items.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
const containers = document.querySelectorAll('.shuffle-items')
containers.forEach((container) => {
for (let i = container.children.length; i >= 0; i--) {
container.appendChild(container.children[(Math.random() * i) | 0])
}
})
if (!window.location.pathname.includes('/edit/')) {
const containers = document.querySelectorAll('.shuffle-items')
containers.forEach((container) => {
for (let i = container.children.length; i >= 0; i--) {
container.appendChild(container.children[(Math.random() * i) | 0])
}
})
}

0 comments on commit a21644b

Please sign in to comment.