mirror of
https://github.com/bigskysoftware/htmx.git
synced 2025-10-02 15:25:26 +00:00
play nice w/ other software that uses window.onpopstate
This commit is contained in:
parent
fec34cb18e
commit
d3d5155085
@ -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 () {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user