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

Unified Diff: chrome/browser/resources/ntp4/tile_page.js

Issue 7622020: [ntp4] Apply style tweaks so that bookmarks page scrolls correctly. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 4 months 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
« no previous file with comments | « chrome/browser/resources/ntp4/bookmarks_page.css ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/ntp4/tile_page.js
===================================================================
--- chrome/browser/resources/ntp4/tile_page.js (revision 96867)
+++ chrome/browser/resources/ntp4/tile_page.js (working copy)
@@ -793,17 +793,21 @@
this.scrollbarUpdate_ = 0;
var content = this.content_;
- if (content.scrollHeight == content.clientHeight) {
+
+ // Adjust height to account for possible header-bar.
+ var adjustedClientHeight = content.clientHeight - content.offsetTop;
+
+ if (content.scrollHeight == adjustedClientHeight) {
this.scrollbar_.hidden = true;
return;
} else {
this.scrollbar_.hidden = false;
}
- var thumbTop = content.scrollTop / content.scrollHeight *
+ var thumbTop = content.offsetTop +
+ content.scrollTop / content.scrollHeight * adjustedClientHeight;
+ var thumbHeight = adjustedClientHeight / content.scrollHeight *
this.clientHeight;
- var thumbHeight = content.clientHeight / content.scrollHeight *
- this.clientHeight;
this.scrollbar_.style.top = thumbTop + 'px';
this.scrollbar_.style.height = thumbHeight + 'px';
« no previous file with comments | « chrome/browser/resources/ntp4/bookmarks_page.css ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698