diff options
| author | Bnyro <bnyro@tutanota.com> | 2025-01-20 18:20:57 +0100 |
|---|---|---|
| committer | Bnyro <bnyro@tutanota.com> | 2025-01-20 18:46:31 +0100 |
| commit | e92d1bc6af5a301938ebe6e3c66377f4c1aece22 (patch) | |
| tree | d0ade22a7a3ccafa08e790f86a06723d2eedbc60 /searx/static | |
| parent | f766faca3fa48a8c2fe65d4a72f318857a01dbd5 (diff) | |
[fix] results.js: back button not working after closing image result manually
Diffstat (limited to 'searx/static')
| -rw-r--r-- | searx/static/themes/simple/src/js/main/results.js | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/searx/static/themes/simple/src/js/main/results.js b/searx/static/themes/simple/src/js/main/results.js index ed40086ca..e7c34aded 100644 --- a/searx/static/themes/simple/src/js/main/results.js +++ b/searx/static/themes/simple/src/js/main/results.js @@ -91,8 +91,10 @@ searxng.scrollPageToSelected(); }; - searxng.closeDetail = function (e) { + searxng.closeDetail = function () { d.getElementById('results').classList.remove('image-detail-open'); + // remove #image-viewer hash from url by navigating back + if (window.location.hash == '#image-viewer') window.history.back(); searxng.scrollPageToSelected(); }; searxng.on('.result-detail-close', 'click', e => { @@ -110,7 +112,7 @@ // listen for the back button to be pressed and dismiss the image details when called window.addEventListener('hashchange', () => { - if (!window.location.hash) searxng.closeDetail(); + if (window.location.hash != '#image-viewer') searxng.closeDetail(); }); d.querySelectorAll('.swipe-horizontal').forEach( |