File tree Expand file tree Collapse file tree 3 files changed +7
-7
lines changed
librustdoc/html/static/js Expand file tree Collapse file tree 3 files changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -737,7 +737,7 @@ function loadCss(cssFileName) {
737737
738738 window . rustdocMobileScrollLock = function ( ) {
739739 const mobile_topbar = document . querySelector ( ".mobile-topbar" ) ;
740- if ( window . innerWidth < window . RUSTDOC_MOBILE_BREAKPOINT ) {
740+ if ( window . innerWidth <= window . RUSTDOC_MOBILE_BREAKPOINT ) {
741741 // This is to keep the scroll position on mobile.
742742 oldSidebarScrollPosition = window . scrollY ;
743743 document . body . style . width = `${ document . body . offsetWidth } px` ;
@@ -783,7 +783,7 @@ function loadCss(cssFileName) {
783783 }
784784
785785 window . addEventListener ( "resize" , ( ) => {
786- if ( window . innerWidth >= window . RUSTDOC_MOBILE_BREAKPOINT &&
786+ if ( window . innerWidth > window . RUSTDOC_MOBILE_BREAKPOINT &&
787787 oldSidebarScrollPosition !== null ) {
788788 // If the user opens the sidebar in "mobile" mode, and then grows the browser window,
789789 // 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");
1212// WARNING: RUSTDOC_MOBILE_BREAKPOINT MEDIA QUERY
1313// If you update this line, then you also need to update the media query with the same
1414// warning in rustdoc.css
15- window . RUSTDOC_MOBILE_BREAKPOINT = 701 ;
15+ window . RUSTDOC_MOBILE_BREAKPOINT = 700 ;
1616
1717const settingsDataset = ( function ( ) {
1818 const settingsElement = document . getElementById ( "default-settings" ) ;
Original file line number Diff line number Diff line change 11// This test ensures that the mobile sidebar preserves scroll position.
22goto: "file://" + |DOC_PATH| + "/test_docs/struct.Foo.html"
33// Switching to "mobile view" by reducing the width to 600px.
4- size: (600 , 600)
4+ size: (700 , 600)
55assert-css: (".sidebar", {"display": "block", "left": "-1000px"})
66
77// Scroll down.
88scroll-to: "//h2[@id='blanket-implementations']"
9- assert-window-property: {"pageYOffset": "651 "}
9+ assert-window-property: {"pageYOffset": "627 "}
1010
1111// Open the sidebar menu.
1212click: ".sidebar-menu-toggle"
@@ -21,11 +21,11 @@ assert-window-property: {"pageYOffset": "0"}
2121// Close the sidebar menu. Make sure the scroll position gets restored.
2222click: ".sidebar-menu-toggle"
2323wait-for-css: (".sidebar", {"left": "-1000px"})
24- assert-window-property: {"pageYOffset": "651 "}
24+ assert-window-property: {"pageYOffset": "627 "}
2525
2626// Now test that scrollability returns when the browser window is just resized.
2727click: ".sidebar-menu-toggle"
2828wait-for-css: (".sidebar", {"left": "0px"})
2929assert-window-property: {"pageYOffset": "0"}
3030size: (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