Before comes before After

This commit is contained in:
Jose Farias
2025-01-15 20:14:30 -06:00
parent 3ab6ee84d0
commit 40085b16d6
@@ -48,18 +48,18 @@ export default class extends Controller {
if (isDroppable) event.preventDefault()
}
#positionDividerAfter(index) {
const position = Math.min(index, this.#items.length - 1, this.maxCountValue)
this.#items[position].after(this.dividerTarget)
this.countTarget.textContent = position
}
#positionDividerBefore(index) {
const position = Math.max(index, 1)
this.#items[position].before(this.dividerTarget)
this.countTarget.textContent = position
}
#positionDividerAfter(index) {
const position = Math.min(index, this.#items.length - 1, this.maxCountValue)
this.#items[position].after(this.dividerTarget)
this.countTarget.textContent = position
}
get #items() {
return Array.from(this.element.children)
}