Skip to content

Commit

Permalink
revert style change
Browse files Browse the repository at this point in the history
  • Loading branch information
hcdeng committed Mar 25, 2024
1 parent 0ce534b commit 9c2bd18
Showing 1 changed file with 12 additions and 13 deletions.
25 changes: 12 additions & 13 deletions src/core/streams/actions/morph.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,20 +26,19 @@ function beforeNodeRemoved(node) {
}

function beforeNodeMorphed(target, newElement) {
if (!(target instanceof HTMLElement)) {
return
}
if (!target.hasAttribute("data-turbo-permanent")) {
const event = dispatch("turbo:before-morph-element", {
cancelable: true,
target,
detail: {
newElement
}
})
return !event.defaultPrevented
if (target instanceof HTMLElement) {
if (!target.hasAttribute("data-turbo-permanent")) {
const event = dispatch("turbo:before-morph-element", {
cancelable: true,
target,
detail: {
newElement
}
})
return !event.defaultPrevented
}
return false
}
return false
}

function beforeAttributeUpdated(attributeName, target, mutationType) {
Expand Down

0 comments on commit 9c2bd18

Please sign in to comment.