chiark / gitweb /
doxygen: the search might lead to the same page, so restore the scrollbar.
authorVladimír Vondruš <mosra@centrum.cz>
Sun, 11 Feb 2018 21:43:36 +0000 (22:43 +0100)
committerVladimír Vondruš <mosra@centrum.cz>
Sun, 11 Feb 2018 21:43:36 +0000 (22:43 +0100)
doxygen/search.js

index 7575c271da0b4f6a16112f375ffcb81561799e50..25b0955555ca9f4b3fae8bd56482c8a87fc2c740 100644 (file)
@@ -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 */