Merge pull request #411 from jens/trigger-history-restored-after-restore

Trigger historyRestored after history actually has been restored
This commit is contained in:
1cg 2021-03-11 05:11:42 -07:00 committed by GitHub
commit 017e3a065e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1526,7 +1526,6 @@ return (function () {
function restoreHistory(path) {
saveHistory();
path = path || location.pathname+location.search;
triggerEvent(getDocument().body, "htmx:historyRestore", {path:path});
var cached = getCachedHistory(path);
if (cached) {
var fragment = makeFragment(cached.content);
@ -1544,6 +1543,7 @@ return (function () {
loadHistoryFromServer(path);
}
}
triggerEvent(getDocument().body, "htmx:historyRestore", {path:path});
}
function shouldPush(elt) {