Added settlingClass and swappingClass to config variables

This commit is contained in:
Ben Croker 2020-06-30 23:24:17 +02:00 committed by GitHub
parent 9ed66d5130
commit 3fd502af73
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1522,7 +1522,7 @@ return (function () {
var swapSpec = getSwapSpecification(elt); var swapSpec = getSwapSpecification(elt);
target.classList.add("htmx-swapping"); target.classList.add(htmx.config.swappingClass);
var doSwap = function () { var doSwap = function () {
try { try {
@ -1544,10 +1544,10 @@ return (function () {
newActiveElt.focus(); newActiveElt.focus();
} }
target.classList.remove("htmx-swapping"); target.classList.remove(htmx.config.swappingClass);
forEach(settleInfo.elts, function (elt) { forEach(settleInfo.elts, function (elt) {
if (elt.classList) { if (elt.classList) {
elt.classList.add("htmx-settling"); elt.classList.add(htmx.config.settlingClass);
} }
triggerEvent(elt, 'afterSwap.htmx', eventDetail); triggerEvent(elt, 'afterSwap.htmx', eventDetail);
}); });
@ -1560,7 +1560,7 @@ return (function () {
}); });
forEach(settleInfo.elts, function (elt) { forEach(settleInfo.elts, function (elt) {
if (elt.classList) { if (elt.classList) {
elt.classList.remove("htmx-settling"); elt.classList.remove(htmx.config.settlingClass);
} }
triggerEvent(elt, 'afterSettle.htmx', eventDetail); triggerEvent(elt, 'afterSettle.htmx', eventDetail);
}); });
@ -1734,7 +1734,9 @@ return (function () {
defaultSettleDelay:100, defaultSettleDelay:100,
includeIndicatorStyles:true, includeIndicatorStyles:true,
indicatorClass:'htmx-indicator', indicatorClass:'htmx-indicator',
requestClass:'htmx-request' requestClass:'htmx-request',
settlingClass:'htmx-settling',
swappingClass:'htmx-swapping',
}, },
parseInterval:parseInterval, parseInterval:parseInterval,
_:internalEval, _:internalEval,