Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(361)

Unified Diff: chrome/browser/resources/help/help_base_page.js

Issue 68723003: Make chrome/ be documentElement/body agnostic with regards to scrollTop/Left (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@issue_305800
Patch Set: Created 7 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/resources/help/help_base_page.js
diff --git a/chrome/browser/resources/help/help_base_page.js b/chrome/browser/resources/help/help_base_page.js
index f07a9f1e0cd58df9eaf3c7ef0ce582f47325e0cf..52d30591bd989fbcf34b1101dc8cb9d5c2bd23a9 100644
--- a/chrome/browser/resources/help/help_base_page.js
+++ b/chrome/browser/resources/help/help_base_page.js
@@ -115,13 +115,16 @@ cr.define('help', function() {
* @private
*/
freeze_: function(freeze) {
+ var scrollTop = scrollTopForDocument(document);
+ var scrollLeft = scrollLeftForDocument(document);
+
if (freeze) {
- this.lastScrollTop = document.documentElement.scrollTop;
+ this.lastScrollTop = scrollTop;
Dan Beam 2013/11/13 23:31:07 nit: replace `var scrollTop = ...;` with: this.
document.body.style.overflow = 'hidden';
- window.scroll(document.documentElement.scrollLeft, 0);
+ window.scroll(scrollLeft, 0);
} else {
document.body.style.overflow = 'auto';
- window.scroll(document.documentElement.scrollLeft, this.lastScrollTop);
+ window.scroll(scrollLeft, this.lastScrollTop);
}
},

Powered by Google App Engine
This is Rietveld 408576698