mirror of
https://github.com/readthedocs/sphinx_rtd_theme.git
synced 2025-02-25 18:55:21 -06:00
Merge b8535aee8f
into 5a263753d5
This commit is contained in:
commit
f19c79a008
File diff suppressed because one or more lines are too long
10
src/theme.js
10
src/theme.js
@ -160,7 +160,15 @@ function ThemeNav () {
|
||||
.addClass('current')
|
||||
.attr('aria-expanded','true');
|
||||
}
|
||||
link[0].scrollIntoView();
|
||||
/* Scroll the link's top-level parent into view first. Then
|
||||
* scroll the link itself into view, which will only have an
|
||||
* effect if the top-level parent is taller than the viewport
|
||||
* and the link is still outside the viewport after the first
|
||||
* scroll. (This seems likely to be rare.)
|
||||
*/
|
||||
link.closest('li.toctree-l1')[0]
|
||||
.scrollIntoView({block: "nearest"});
|
||||
link[0].scrollIntoView({block: "nearest"});
|
||||
}
|
||||
}
|
||||
catch (err) {
|
||||
|
Loading…
Reference in New Issue
Block a user