summaryrefslogtreecommitdiffstatshomepage
path: root/dist/htmx.js
diff options
context:
space:
mode:
authorCarson Gross <carson@bigsky.software>2023-03-02 13:13:01 -0700
committerCarson Gross <carson@bigsky.software>2023-03-02 13:13:01 -0700
commit15d4cacbf3c4bf59c09fb4eb78b07dfb3ea3711a (patch)
tree617482d75901765286652a6fda3c0f4f20766d99 /dist/htmx.js
parent6a81e177e262eecfbfce06e275d0634693eacfde (diff)
downloadhtmx-15d4cacbf3c4bf59c09fb4eb78b07dfb3ea3711a.tar.gz
htmx-15d4cacbf3c4bf59c09fb4eb78b07dfb3ea3711a.zip
prep 1.8.6 tests
Diffstat (limited to 'dist/htmx.js')
-rw-r--r--dist/htmx.js16
1 files changed, 11 insertions, 5 deletions
diff --git a/dist/htmx.js b/dist/htmx.js
index 794f3a2c..b7312271 100644
--- a/dist/htmx.js
+++ b/dist/htmx.js
@@ -81,7 +81,7 @@ return (function () {
sock.binaryType = htmx.config.wsBinaryType;
return sock;
},
- version: "1.8.5"
+ version: "1.8.6"
};
/** @type {import("./htmx").HtmxInternalApi} */
@@ -792,7 +792,8 @@ return (function () {
function handleAttributes(parentNode, fragment, settleInfo) {
forEach(fragment.querySelectorAll("[id]"), function (newNode) {
if (newNode.id && newNode.id.length > 0) {
- var oldNode = parentNode.querySelector(newNode.tagName + "[id='" + newNode.id + "']");
+ var normalizedId = newNode.id.replace("'", "\\'");
+ var oldNode = parentNode.querySelector(newNode.tagName + "[id='" + normalizedId + "']");
if (oldNode && oldNode !== parentNode) {
var newAttributes = newNode.cloneNode();
cloneAttributes(newNode, oldNode);
@@ -1323,12 +1324,17 @@ return (function () {
}
function addEventListener(elt, handler, nodeData, triggerSpec, explicitCancel) {
+ var elementData = getInternalData(elt);
var eltsToListenOn;
if (triggerSpec.from) {
eltsToListenOn = querySelectorAllExt(elt, triggerSpec.from);
} else {
eltsToListenOn = [elt];
}
+ // store the initial value of the element so we can tell if it changes
+ if (triggerSpec.changed) {
+ elementData.lastValue = elt.value;
+ }
forEach(eltsToListenOn, function (eltToListenOn) {
var eventListener = function (evt) {
if (!bodyContains(elt)) {
@@ -1349,7 +1355,6 @@ return (function () {
if (eventData.handledFor == null) {
eventData.handledFor = [];
}
- var elementData = getInternalData(elt);
if (eventData.handledFor.indexOf(elt) < 0) {
eventData.handledFor.push(elt);
if (triggerSpec.consume) {
@@ -1404,7 +1409,7 @@ return (function () {
on: eltToListenOn
})
eltToListenOn.addEventListener(triggerSpec.trigger, eventListener);
- })
+ });
}
var windowIsScrolling = false // used by initScrollHandler
@@ -2890,7 +2895,7 @@ return (function () {
removeRequestIndicatorClasses(indicators);
triggerEvent(elt, 'htmx:afterRequest', responseInfo);
triggerEvent(elt, 'htmx:afterOnLoad', responseInfo);
- // if the body no longer contains the element, trigger the even on the closest parent
+ // if the body no longer contains the element, trigger the event on the closest parent
// remaining in the DOM
if (!bodyContains(elt)) {
var secondaryTriggerElt = null;
@@ -3097,6 +3102,7 @@ return (function () {
serverResponse = beforeSwapDetails.serverResponse; // allow updating content
isError = beforeSwapDetails.isError; // allow updating error
+ responseInfo.target = target; // Make updated target available to response events
responseInfo.failed = isError; // Make failed property available to response events
responseInfo.successful = !isError; // Make successful property available to response events