diff options
author | carson <carson@leaddyno.com> | 2020-06-30 10:45:38 -0700 |
---|---|---|
committer | carson <carson@leaddyno.com> | 2020-06-30 10:45:38 -0700 |
commit | b22b1d104c2a7e7097923c3d7a66e1d19ff56c04 (patch) | |
tree | 61eb96fa822ac0893e1697aa6408613c4ee300af /src | |
parent | 4f3cf2d889ff549422ed2bb135fc5775f7e54dab (diff) | |
parent | 2fbe230853512b05f0ead8afaf63517280204b86 (diff) | |
download | htmx-b22b1d104c2a7e7097923c3d7a66e1d19ff56c04.tar.gz htmx-b22b1d104c2a7e7097923c3d7a66e1d19ff56c04.zip |
Merge remote-tracking branch 'origin/dev' into dev
Diffstat (limited to 'src')
-rw-r--r-- | src/htmx.js | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/htmx.js b/src/htmx.js index 50cb172d..2c311130 100644 --- a/src/htmx.js +++ b/src/htmx.js @@ -1123,10 +1123,16 @@ return (function () { } function shouldPush(elt) { - return getClosestAttributeValue(elt, "hx-push-url") === "true" || + var pushUrl = getClosestAttributeValue(elt, "hx-push-url"); + return (pushUrl && pushUrl !== "false") || (elt.tagName === "A" && getInternalData(elt).boosted); } + function getPushUrl(elt) { + var pushUrl = getClosestAttributeValue(elt, "hx-push-url"); + return (pushUrl === "true" || pushUrl === "false") ? null : pushUrl; + } + function addRequestIndicatorClasses(elt) { mutateRequestIndicatorClasses(elt, "add"); } @@ -1560,7 +1566,7 @@ return (function () { }); // push URL and save new page if (shouldSaveHistory) { - var pathToPush = pushedUrl || finalPathForGet || path; + var pathToPush = pushedUrl || getPushUrl(elt) || finalPathForGet || path; pushUrlIntoHistory(pathToPush); triggerEvent(getDocument().body, 'htmx:pushedIntoHistory', {path:pathToPush}); } |