diff options
author | arv@chromium.org <arv@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-01-06 00:44:11 +0000 |
---|---|---|
committer | arv@chromium.org <arv@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-01-06 00:44:11 +0000 |
commit | 6ee22a27d2d8436091feb92e8395c0644b04b8e9 (patch) | |
tree | 0709190be661d4f4cde011b7caac0a0428fb64ac | |
parent | 8aa8d639884f8dd3b10454df6d44d97575b1cd34 (diff) | |
download | chromium_src-6ee22a27d2d8436091feb92e8395c0644b04b8e9.zip chromium_src-6ee22a27d2d8436091feb92e8395c0644b04b8e9.tar.gz chromium_src-6ee22a27d2d8436091feb92e8395c0644b04b8e9.tar.bz2 |
NTP: Fix issue where multiple calls to showNotification was broken.
BUG=68432
TEST=Manually by calling showNotification multiple times.
Review URL: http://codereview.chromium.org/5985011
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@70568 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome/browser/resources/new_new_tab.js | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/chrome/browser/resources/new_new_tab.js b/chrome/browser/resources/new_new_tab.js index da3740d..8be2ac5 100644 --- a/chrome/browser/resources/new_new_tab.js +++ b/chrome/browser/resources/new_new_tab.js @@ -920,15 +920,15 @@ function showNotification(message, actionText, opt_f, opt_delay) { notification.classList.remove('first-run'); notification.classList.remove('promo'); - var notificationNode = notificationElement.firstElementChild; - notificationNode.removeChild(notificationNode.firstChild); - + var messageContainer = notificationElement.firstElementChild; var actionLink = notificationElement.querySelector('.link-color'); - if (typeof message == 'string') - notificationElement.firstElementChild.textContent = message; - else - notificationElement.firstElementChild.appendChild(message); + if (typeof message == 'string') { + messageContainer.textContent = message; + } else { + messageContainer.textContent = ''; // Remove all children. + messageContainer.appendChild(message); + } actionLink.textContent = actionText; |