From: Vladimír Vondruš Date: Sun, 11 Feb 2018 21:43:36 +0000 (+0100) Subject: doxygen: the search might lead to the same page, so restore the scrollbar. X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~cjwatson/git?a=commitdiff_plain;h=3a80fc0f74b8568da6e52c5247b39625b9447cce;p=blog.git doxygen: the search might lead to the same page, so restore the scrollbar. --- diff --git a/doxygen/search.js b/doxygen/search.js index 7575c271..25b09555 100644 --- a/doxygen/search.js +++ b/doxygen/search.js @@ -552,7 +552,11 @@ if(typeof document !== 'undefined') { /* Go to result */ } else if(event.key == 'Enter') { document.getElementById('search-current').firstElementChild.click(); - return false; /* so the keypress doesn't affect input cursor */ + + /* We might be staying on the same page, so restore scrollbar, + and prevent page layout jumps */ + document.body.style.overflow = 'auto'; + document.body.style.paddingRight = '0'; } /* Search hidden */