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

Unified Diff: chrome/browser/resources/new_tab.js

Issue 7399015: Sync Promo: Add a way to collapse the sync promo (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: address review feedback Created 9 years, 5 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
Index: chrome/browser/resources/new_tab.js
diff --git a/chrome/browser/resources/new_tab.js b/chrome/browser/resources/new_tab.js
index 148dcb1686110f6e4cf9d729ebf359d8bab860e6..952f2b61eceb039e04e2e0339c5ad6b4e963d03c 100644
--- a/chrome/browser/resources/new_tab.js
+++ b/chrome/browser/resources/new_tab.js
@@ -488,6 +488,10 @@ function layoutSections() {
}
}
+ // Include the height of the sync promo bar.
+ var sync_promo_height = $('sync-promo').offsetHeight;
+ headerHeight += sync_promo_height;
+
// Calculate the height of the fixed elements below the expanded section, if
// any.
for (; section = sections[i]; i++) {
@@ -535,7 +539,7 @@ function layoutSections() {
maxiviewVisibleHeight = expandedSectionHeight;
// Now position all the elements.
- var y = LAYOUT_SPACING_TOP;
+ var y = LAYOUT_SPACING_TOP + sync_promo_height;
for (i = 0, section; section = sections[i]; i++) {
section.section.style.top = y + 'px';
y += section.fixedHeight;
@@ -563,6 +567,9 @@ function layoutSections() {
if (cr.isChromeOS)
$('closed-sections-bar').style.top = y + 'px';
+ // Position the notification container below the sync promo.
+ $('notification-container').style.top = sync_promo_height + 'px';
+
updateMenuSections();
updateAttributionDisplay(y);
}
@@ -1428,7 +1435,6 @@ function updateLogin(login) {
$('login-container').style.display = login ? 'block' : '';
if (login)
$('login-username').textContent = login;
-
}
var mostVisited = new MostVisited(

Powered by Google App Engine
This is Rietveld 408576698