Chromium Code Reviews| Index: chrome/browser/resources/ntp_search/new_tab.js |
| diff --git a/chrome/browser/resources/ntp_search/new_tab.js b/chrome/browser/resources/ntp_search/new_tab.js |
| index 1bb34ebebfc5f2462c14081cfd92492df0e3c5a3..38039215bced0ad63ba41532fdddb711121a5b53 100644 |
| --- a/chrome/browser/resources/ntp_search/new_tab.js |
| +++ b/chrome/browser/resources/ntp_search/new_tab.js |
| @@ -132,13 +132,6 @@ cr.define('ntp', function() { |
| var headerHeight; |
| /** |
| - * The height of the Bottom Panel Footer, in pixels. |
| - * @type {number|undefined} |
| - * @private |
| - */ |
| - var footerHeight; |
| - |
| - /** |
| * The time in milliseconds for most transitions. This should match what's |
| * in new_tab.css. Unfortunately there's no better way to try to time |
| * something to occur until after a transition has completed. |
| @@ -736,9 +729,8 @@ cr.define('ntp', function() { |
| var contentHeight = TILE_ROW_HEIGHT; |
| if (!opt_page && currentPage.config.scrollable) { |
| contentHeight = viewHeight - bottomPanelOffsetTop - |
| - headerHeight - footerHeight; |
| + headerHeight - $('bottom-panel-footer').offsetHeight; |
| contentHeight = Math.max(TILE_ROW_HEIGHT, contentHeight); |
| - contentHeight = Math.min(2 * TILE_ROW_HEIGHT, contentHeight); |
| } |
| this.contentHeight_ = contentHeight; |
| @@ -808,11 +800,8 @@ cr.define('ntp', function() { |
| bottomPanelOffsetTop = $('bottom-panel').offsetTop; |
| headerHeight = $('bottom-panel-header').offsetHeight; |
| - footerHeight = $('bottom-panel-footer').offsetHeight; |
| notificationContainer = getRequiredElement('notification-container'); |
| - notificationContainer.addEventListener( |
| - 'webkitTransitionEnd', onNotificationTransitionEnd); |
| var mostVisited = new ntp.MostVisitedPage(); |
| newTabView.appendTilePage(mostVisited, |
| @@ -1005,30 +994,23 @@ cr.define('ntp', function() { |
| document.querySelector('#notification button').onclick = closeFunc; |
| document.addEventListener('dragstart', closeFunc); |
| - notificationContainer.hidden = false; |
| window.setTimeout(function() { |
|
Dan Beam
2012/12/14 05:52:32
the setTimeout is no longer needed (was just there
pedro (no code reviews)
2012/12/14 06:12:06
Oh, okay, now I see what you were saying. The setT
|
| - notificationContainer.classList.remove('inactive'); |
| + notificationContainer.hidden = false; |
| }, 0); |
| var timeout = opt_timeout || 10000; |
| notificationTimeout = window.setTimeout(hideNotification, timeout); |
| + |
| + layout(); |
| } |
| /** |
| * Hide the notification bubble. |
| */ |
| function hideNotification() { |
| - notificationContainer.classList.add('inactive'); |
| - } |
| + notificationContainer.hidden = true; |
| - /** |
| - * When done fading out, set hidden to true so the notification can't be |
| - * tabbed to or clicked. |
| - * @param {Event} e The webkitTransitionEnd event. |
| - */ |
| - function onNotificationTransitionEnd(e) { |
| - if (notificationContainer.classList.contains('inactive')) |
| - notificationContainer.hidden = true; |
| + layout(); |
| } |
| function setMostVisitedPages(dataList, hasBlacklistedUrls) { |
| @@ -1104,8 +1086,8 @@ cr.define('ntp', function() { |
| newTabView.highlightAppId = appId; |
| } |
| - function layout(opt_animate) { |
| - newTabView.layout(opt_animate); |
| + function layout() { |
| + newTabView.layout.apply(newTabView, arguments); |
| } |
| function getContentHeight() { |