Skip to content

Commit c9cf86f

Browse files
committed
rename normalSwap to isOOBSwap
1 parent f91f654 commit c9cf86f

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

src/htmx.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1890,7 +1890,7 @@ var htmx = (function() {
18901890
let settleResolve = null
18911891
let settleReject = null
18921892

1893-
const normalSwap = !oobSettleInfo // is this a normal swap or from an oobSwap
1893+
const isOOBSwap = !!oobSettleInfo // calls passing oobSettleInfo are from oobSwap function and can skip some logic
18941894

18951895
let doSwap = function() {
18961896
maybeCall(swapOptions.beforeSwapCallback)
@@ -1927,7 +1927,7 @@ var htmx = (function() {
19271927
fragment = fragment.querySelector('[hx-history-elt],[data-hx-history-elt]') || fragment
19281928
}
19291929

1930-
if (normalSwap) {
1930+
if (!isOOBSwap) {
19311931
// select-oob swaps
19321932
if (swapOptions.selectOOB) {
19331933
const oobSelectValues = swapOptions.selectOOB.split(',')
@@ -1998,7 +1998,7 @@ var htmx = (function() {
19981998
if (elt.classList) {
19991999
elt.classList.add(htmx.config.settlingClass)
20002000
}
2001-
if (normalSwap) {
2001+
if (!isOOBSwap) {
20022002
triggerEvent(elt, 'htmx:afterSwap', swapOptions.eventInfo)
20032003
}
20042004
})
@@ -2043,7 +2043,7 @@ var htmx = (function() {
20432043
}
20442044
}
20452045
}
2046-
let shouldTransition = normalSwap && htmx.config.globalViewTransitions
2046+
let shouldTransition = !isOOBSwap && htmx.config.globalViewTransitions
20472047
if (swapSpec.hasOwnProperty('transition')) {
20482048
shouldTransition = swapSpec.transition
20492049
}

0 commit comments

Comments
 (0)