summaryrefslogtreecommitdiff
path: root/src/scaladoc/scala/tools/nsc/doc/html/resource/lib/index.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/scaladoc/scala/tools/nsc/doc/html/resource/lib/index.js')
-rw-r--r--src/scaladoc/scala/tools/nsc/doc/html/resource/lib/index.js3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/scaladoc/scala/tools/nsc/doc/html/resource/lib/index.js b/src/scaladoc/scala/tools/nsc/doc/html/resource/lib/index.js
index caa6406bc5..494ad91cc8 100644
--- a/src/scaladoc/scala/tools/nsc/doc/html/resource/lib/index.js
+++ b/src/scaladoc/scala/tools/nsc/doc/html/resource/lib/index.js
@@ -98,7 +98,7 @@ function handleKeyNavigation() {
scroller.scrollDown = function($elem) {
var yPos = $elem.offset().top; // offset relative to viewport
- if ($container.height() < yPos) {
+ if ($container.height() < yPos || (yPos - $("#search").height()) < 0) {
$container.animate({
scrollTop: $container.scrollTop() + yPos - $("#search").height() - 10
}, 200);
@@ -132,6 +132,7 @@ function handleKeyNavigation() {
var $old = items.next();
$old.addClass("selected");
+ scroller.scrollDown($old);
$(window).bind("keydown", function(e) {
switch ( e.keyCode ) {