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