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

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

Issue 7787014: ntp4: fix positioning of notification bar (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 3 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.html ('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 8662374399d4f53fbd48cd04e7cac3a93b77e53a..f98b15e69571f657dd2b6307290d523efb87ea52 100644
--- a/chrome/browser/resources/ntp4/new_tab.js
+++ b/chrome/browser/resources/ntp4/new_tab.js
@@ -56,6 +56,12 @@ cr.define('ntp4', function() {
var dotList;
/**
+ * The 'notification-container' element.
+ * @type {!Element|undefined}
+ */
+ var notificationContainer;
+
+ /**
* The left and right paging buttons.
* @type {!Element|undefined}
*/
@@ -155,6 +161,10 @@ cr.define('ntp4', function() {
pageSwitcherEnd = getRequiredElement('page-switcher-end');
ntp4.initializePageSwitcher(pageSwitcherEnd);
+ notificationContainer = getRequiredElement('notification-container');
+ notificationContainer.addEventListener(
+ 'webkitTransitionEnd', onNotificationTransitionEnd);
+
// Initialize the cardSlider without any cards at the moment
var sliderFrame = getRequiredElement('card-slider-frame');
cardSlider = new CardSlider(sliderFrame, pageList, sliderFrame.offsetWidth);
@@ -711,7 +721,8 @@ cr.define('ntp4', function() {
};
var timeout = opt_timeout || 10000;
- $('notification').classList.remove('inactive');
+ notificationContainer.hidden = false;
+ notificationContainer.classList.remove('inactive');
notificationTimeout_ = window.setTimeout(hideNotification, timeout);
}
@@ -719,7 +730,16 @@ cr.define('ntp4', function() {
* Hide the notification bubble.
*/
function hideNotification() {
- $('notification').classList.add('inactive');
+ notificationContainer.classList.add('inactive');
+ }
+
+ /**
+ * When done fading out, set hidden to true so the notification can't be
+ * tabbed to or clicked.
+ */
+ function onNotificationTransitionEnd(e) {
+ if (notificationContainer.classList.contains('inactive'));
+ notificationContainer.hidden = true;
}
function setRecentlyClosedTabs(dataItems) {
« no previous file with comments | « chrome/browser/resources/ntp4/new_tab.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698