File tree 3 files changed +7
-7
lines changed
librustdoc/html/static/js
3 files changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -737,7 +737,7 @@ function loadCss(cssFileName) {
737
737
738
738
window . rustdocMobileScrollLock = function ( ) {
739
739
const mobile_topbar = document . querySelector ( ".mobile-topbar" ) ;
740
- if ( window . innerWidth < window . RUSTDOC_MOBILE_BREAKPOINT ) {
740
+ if ( window . innerWidth <= window . RUSTDOC_MOBILE_BREAKPOINT ) {
741
741
// This is to keep the scroll position on mobile.
742
742
oldSidebarScrollPosition = window . scrollY ;
743
743
document . body . style . width = `${ document . body . offsetWidth } px` ;
@@ -783,7 +783,7 @@ function loadCss(cssFileName) {
783
783
}
784
784
785
785
window . addEventListener ( "resize" , ( ) => {
786
- if ( window . innerWidth >= window . RUSTDOC_MOBILE_BREAKPOINT &&
786
+ if ( window . innerWidth > window . RUSTDOC_MOBILE_BREAKPOINT &&
787
787
oldSidebarScrollPosition !== null ) {
788
788
// If the user opens the sidebar in "mobile" mode, and then grows the browser window,
789
789
// we need to switch away from mobile mode and make the main content area scrollable.
Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ window.mainTheme = document.getElementById("mainThemeStyle");
12
12
// WARNING: RUSTDOC_MOBILE_BREAKPOINT MEDIA QUERY
13
13
// If you update this line, then you also need to update the media query with the same
14
14
// warning in rustdoc.css
15
- window . RUSTDOC_MOBILE_BREAKPOINT = 701 ;
15
+ window . RUSTDOC_MOBILE_BREAKPOINT = 700 ;
16
16
17
17
const settingsDataset = ( function ( ) {
18
18
const settingsElement = document . getElementById ( "default-settings" ) ;
Original file line number Diff line number Diff line change 1
1
// This test ensures that the mobile sidebar preserves scroll position.
2
2
goto: "file://" + |DOC_PATH| + "/test_docs/struct.Foo.html"
3
3
// Switching to "mobile view" by reducing the width to 600px.
4
- size: (600 , 600)
4
+ size: (700 , 600)
5
5
assert-css: (".sidebar", {"display": "block", "left": "-1000px"})
6
6
7
7
// Scroll down.
8
8
scroll-to: "//h2[@id='blanket-implementations']"
9
- assert-window-property: {"pageYOffset": "651 "}
9
+ assert-window-property: {"pageYOffset": "627 "}
10
10
11
11
// Open the sidebar menu.
12
12
click: ".sidebar-menu-toggle"
@@ -21,11 +21,11 @@ assert-window-property: {"pageYOffset": "0"}
21
21
// Close the sidebar menu. Make sure the scroll position gets restored.
22
22
click: ".sidebar-menu-toggle"
23
23
wait-for-css: (".sidebar", {"left": "-1000px"})
24
- assert-window-property: {"pageYOffset": "651 "}
24
+ assert-window-property: {"pageYOffset": "627 "}
25
25
26
26
// Now test that scrollability returns when the browser window is just resized.
27
27
click: ".sidebar-menu-toggle"
28
28
wait-for-css: (".sidebar", {"left": "0px"})
29
29
assert-window-property: {"pageYOffset": "0"}
30
30
size: (900, 600)
31
- assert-window-property: {"pageYOffset": "651 "}
31
+ assert-window-property: {"pageYOffset": "627 "}
You can’t perform that action at this time.
0 commit comments