Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelWest22 committed Sep 25, 2024
1 parent bcbdc45 commit ba7b696
Showing 1 changed file with 0 additions and 7 deletions.
7 changes: 0 additions & 7 deletions docs/htmx.js
Original file line number Diff line number Diff line change
Expand Up @@ -1487,7 +1487,6 @@ var htmx = (function() {
forEach(findAll(fragment, '[hx-preserve], [data-hx-preserve]'), function(preservedElt) {
const id = getAttributeValue(preservedElt, 'id')
const value = getAttributeValue(preservedElt, 'hx-preserve')
const existingElement = getDocument().getElementById(id)
if (existingElement != null) {
if (preservedElt.moveBefore) { // if the moveBefore API exists, use it
// get or create a storage spot for stuff
Expand All @@ -1497,15 +1496,9 @@ var htmx = (function() {
pantry = find('#--htmx-preserve-pantry--')
}
// @ts-ignore - use proposed moveBefore feature
if (value != 'relocate') {
existingElement.insertAdjacentHTML('beforebegin', `<div id="${id}"></div>`)
}
pantry.moveBefore(existingElement, null)
} else {
preservedElt.parentNode.replaceChild(existingElement, preservedElt)
if (value == 'relocate') {
existingElement.remove()
}
}
}
})
Expand Down

0 comments on commit ba7b696

Please sign in to comment.