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

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

Issue 7833021: [ntp4] Add a 'Manage Bookmarks' link at the top of the Bookmarks page. Also right-align links. (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/bookmarks_page.css ('k') | chrome/browser/resources/ntp4/new_tab.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/ntp4/bookmarks_page.js
===================================================================
--- chrome/browser/resources/ntp4/bookmarks_page.js (revision 99697)
+++ chrome/browser/resources/ntp4/bookmarks_page.js (working copy)
@@ -230,18 +230,15 @@
initialize: function() {
this.classList.add('bookmarks-page');
- // insert the bookmark titles header which is unique to bookmark pages.
+ // Insert the bookmark titles header which is unique to bookmark pages.
this.insertBefore($('bookmarks-title-wrapper'), this.firstChild);
- // insert a container for a link to a Bookmarks Manager page.
- var link = document.createElement('a');
- link.className = 'bookmarks-manager-link';
- link.textContent = localStrings.getString('bookmarksManagerLinkTitle');
- var container = document.createElement('div');
- container.className = 'bookmarks-manager-link-container';
- container.hidden = true;
- container.appendChild(link);
- this.querySelector('.tile-page-content').appendChild(container);
+ // Insert the top & bottom links for the Bookmarks Manager page.
+ var pageContent = this.querySelector('.tile-page-content');
+ var topWrapper = $('bookmarks-top-link-wrapper');
+ pageContent.insertBefore(topWrapper, pageContent.firstChild);
+ topWrapper.hidden = false;
+ pageContent.appendChild($('bookmarks-bottom-link-wrapper'));
},
/**
@@ -278,13 +275,16 @@
for (var i = 0; i < tile_count; i++)
this.appendTile(new Bookmark(items[i]), false);
- var container = this.querySelector('.bookmarks-manager-link-container');
+ var link = $('bookmarks-top-link-wrapper').querySelector('a');
+ link.href = 'chrome://bookmarks/#' + this.id;
+
+ var wrapper = $('bookmarks-bottom-link-wrapper');
if (items.length > MAX_BOOKMARK_TILES) {
- var link = container.querySelector('.bookmarks-manager-link');
+ var link = wrapper.querySelector('a');
link.href = 'chrome://bookmarks/#' + this.id;
- container.hidden = false;
+ wrapper.hidden = false;
} else {
- container.hidden = true;
+ wrapper.hidden = true;
}
},
@@ -447,6 +447,11 @@
this.updateBookmarkTiles_(data.items);
this.updateBookmarkTitles_(data.navigationItems);
},
+
+ /** @inheritDoc */
+ get extraBottomPadding() {
+ return 40;
+ },
};
/**
« no previous file with comments | « chrome/browser/resources/ntp4/bookmarks_page.css ('k') | chrome/browser/resources/ntp4/new_tab.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698