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

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

Issue 1618: Makes new tab page update properly when its told bookmarks are... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 12 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/new_tab.html
===================================================================
--- chrome/browser/resources/new_tab.html (revision 1820)
+++ chrome/browser/resources/new_tab.html (working copy)
@@ -373,6 +373,7 @@
<div id="recentlyBookmarked" class="sidebar" style="display:none">
<span class="section-title" jscontent="bookmarks"></span>
+ <div id="recentlyBookmarkedContainer"></div>
</div>
<div id="recentlyClosedTabs" class="sidebar" style="display:none">
@@ -537,10 +538,16 @@
attributes. */
function renderRecentlyBookmarked(entries) {
logEvent('renderRecentlyBookmarked called: ' + entries.length);
- var container = document.getElementById('recentlyBookmarked');
+ var section = document.getElementById('recentlyBookmarked');
+ var container = document.getElementById('recentlyBookmarkedContainer');
+ /* recentlyBookmarked is called any time the bookmarks change. Remove existing
+ entries before adding new ones. */
+ section.style.display = 'none';
+ container.innerHTML = '';
+
if (entries.length > 0) {
- container.style.display = 'block';
+ section.style.display = 'block';
for (var i = 0, entry = entries[0]; entry = entries[i]; ++i) {
var link = DOM('a', {href: entry.url, className:'recent-bookmark', title:entry.title});
link.style.backgroundImage =
@@ -564,9 +571,7 @@
date. Therefore, reset the recentlyClosedTabs state on every
call. */
section.style.display = 'none';
- while(container.hasChildNodes()) {
- container.removeChild(container.firstChild);
- }
+ container.innerHTML = '';
if (entries.length > 0) {
section.style.display = 'block';
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698