edit the htmls
This commit is contained in:
@@ -1,5 +1,13 @@
|
||||
{{ block "script" .}}
|
||||
<script>
|
||||
function clickBackButton() {
|
||||
console.log('Back button clicked', window.history.state);
|
||||
if (window.history.state && window.history.state["htmx"]) {
|
||||
window.history.back();
|
||||
} else {
|
||||
window.location.href = '/';
|
||||
}
|
||||
}
|
||||
function setScatteredWordsVisibility() {
|
||||
const scatteredWords = document.getElementById('scatteredWords');
|
||||
if (!scatteredWords) return;
|
||||
@@ -18,7 +26,8 @@
|
||||
setScatteredWordsVisibility();
|
||||
});
|
||||
|
||||
document.body.addEventListener('htmx:historyRestore', function () {
|
||||
document.body.addEventListener('htmx:historyRestore', function (e) {
|
||||
console.log('Restoring history state', e.detail);
|
||||
setScatteredWordsVisibility();
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user