play nice w/ other software that uses window.onpopstate

This commit is contained in:
Carson Gross 2023-04-26 11:49:28 -06:00
parent fec34cb18e
commit d3d5155085

View File

@ -3536,6 +3536,7 @@ return (function () {
internalData.xhr.abort();
}
});
var originalPopstate = window.onpopstate;
window.onpopstate = function (event) {
if (event.state && event.state.htmx) {
restoreHistory();
@ -3545,6 +3546,10 @@ return (function () {
'triggerEvent': triggerEvent
});
});
} else {
if (originalPopstate) {
originalPopstate(event);
}
}
};
setTimeout(function () {