Brion VIBBER has submitted this change and it was merged.

Change subject: Minor tweaks to scrolling to a section from ToC
......................................................................


Minor tweaks to scrolling to a section from ToC

Make sure that the space from the search bar to the heading
is the same as space from left of screen to heading

Change-Id: I4d95564b12be6a39a83627fed596bb77479be33a
---
M wikipedia/assets/main.js
1 file changed, 4 insertions(+), 2 deletions(-)

Approvals:
  Brion VIBBER: Verified; Looks good to me, approved



diff --git a/wikipedia/assets/main.js b/wikipedia/assets/main.js
index c8b3ffd..202fda6 100644
--- a/wikipedia/assets/main.js
+++ b/wikipedia/assets/main.js
@@ -78,8 +78,10 @@
     } );
 
     bridge.registerListener( "scrollToSection", function ( payload ) {
-        // The 52 is for dealing with the search header
-        var scrollY = document.getElementById( "heading_" + 
payload.sectionID).offsetTop - 52;
+        var el = document.getElementById( "heading_" + payload.sectionID);
+        // Make sure there's exactly as much space on the left as on the top.
+        // The 48 accounts for the search bar
+        var scrollY = el.offsetTop - 48 - el.offsetLeft;
         window.scrollTo(0, scrollY);
     });
 

-- 
To view, visit https://gerrit.wikimedia.org/r/108083
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I4d95564b12be6a39a83627fed596bb77479be33a
Gerrit-PatchSet: 2
Gerrit-Project: apps/android/wikipedia
Gerrit-Branch: master
Gerrit-Owner: Yuvipanda <yuvipa...@gmail.com>
Gerrit-Reviewer: Brion VIBBER <br...@wikimedia.org>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to