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

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

Issue 128013002: Fix apps page footer shrinking/overlap for small window sizes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: delay layoutFooter Created 6 years, 11 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/new_tab.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/new_tab.js
diff --git a/chrome/browser/resources/ntp4/new_tab.js b/chrome/browser/resources/ntp4/new_tab.js
index 30cfab672ce7f99b65a9fec4a7c709da078df5b6..a626afc6141dc123898e8befb07ae3ccd767b5df 100644
--- a/chrome/browser/resources/ntp4/new_tab.js
+++ b/chrome/browser/resources/ntp4/new_tab.js
@@ -373,12 +373,19 @@ cr.define('ntp', function() {
* Layout the footer so that the nav dots stay centered.
*/
function layoutFooter() {
- var menu = $('footer-menu-container');
+ // We need the image to be loaded.
var logo = $('logo-img');
- if (menu.clientWidth > logo.clientWidth)
+ var logoImg = logo.querySelector('img');
+ if (!logoImg.complete) {
+ logoImg.onload = layoutFooter;
+ return;
+ }
+
+ var menu = $('footer-menu-container');
+ if (menu.clientWidth > logoImg.width)
logo.style.WebkitFlex = '0 1 ' + menu.clientWidth + 'px';
else
- menu.style.WebkitFlex = '0 1 ' + logo.clientWidth + 'px';
+ menu.style.WebkitFlex = '0 1 ' + logoImg.width + 'px';
}
function themeChanged(opt_hasAttribution) {
« no previous file with comments | « chrome/browser/resources/ntp4/new_tab.css ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698