Skip to content

Commit 78223ba

Browse files
committed
Update js.
1 parent cce08d8 commit 78223ba

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

docs/_layouts/stdlib-reference.html

+5-1
Original file line numberDiff line numberDiff line change
@@ -373,7 +373,11 @@
373373
// Ensure the selected item is visible.
374374
if (selectedItem != null)
375375
{
376-
selectedItem.scrollIntoView(true);
376+
// is selectedItem visible?
377+
var visible = selectedItem.getBoundingClientRect().y >= 0 &&
378+
selectedItem.getBoundingClientRect().bottom <= tocColumn.getBoundingClientRect().height;
379+
if (!visible)
380+
selectedItem.scrollIntoView(true);
377381
}
378382
var subItems = selectedItem.getElementsByTagName("li");
379383
var subSectionTitles = [];

0 commit comments

Comments
 (0)