Skip to content

Commit ef13659

Browse files
authored
Merge pull request #2112 from loft-sh/docs-fix-css
docs: use regular interval for checking url hash
2 parents ebc6b61 + d3c3dc4 commit ef13659

1 file changed

Lines changed: 16 additions & 6 deletions

File tree

docs/src/js/details-clicks.js

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -92,16 +92,26 @@ const preserveExpansionStates = function (skipEventListener) {
9292
}
9393
});
9494

95-
if (location.host.match(/^localhost(:[0-9]+)?$/)) {
96-
setTimeout(function () {
97-
preserveExpansionStates();
98-
}, 500)
99-
}
95+
setTimeout(function () {
96+
preserveExpansionStates();
97+
}, 300)
10098
}
10199

102100
if (ExecutionEnvironment.canUseDOM) {
103101
preserveExpansionStates();
104-
window.addEventListener("popstate", preserveExpansionStates);
102+
/*
103+
window.addEventListener("popstate", () => {
104+
setTimeout(() => {
105+
preserveExpansionStates();
106+
}, 300)
107+
});
108+
109+
110+
window.addEventListener("hashchange", () => {
111+
setTimeout(() => {
112+
preserveExpansionStates();
113+
}, 300)
114+
});*/
105115

106116
if (location.hash) {
107117
setTimeout(() => {

0 commit comments

Comments
 (0)