From: Vladimír Vondruš Date: Sun, 11 Feb 2018 17:09:29 +0000 (+0100) Subject: doxygen: go back in history when closing search. X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~cjwatson/git?a=commitdiff_plain;h=600a4f5e858841de04ce544528d59aeb333ce3e1;p=blog.git doxygen: go back in history when closing search. Instead of polluting it even more. Makes back button and context preservation behave much better now. --- diff --git a/doxygen/search.js b/doxygen/search.js index f3eeeaa9..e33c7a39 100644 --- a/doxygen/search.js +++ b/doxygen/search.js @@ -489,8 +489,8 @@ function showSearch() { /* istanbul ignore next */ function hideSearch() { - window.location.hash = '#!'; - window.history.pushState('', '', window.location.pathname); + /* Go back to the previous state (that removes the #search hash) */ + window.history.back(); /* Restore scrollbar, prevent page layout jumps */ document.body.style.overflow = 'auto';