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

Side by Side Diff: chrome/browser/resources/ntp4/bookmarks_page.js

Issue 7976009: [ntp4] Make top level Bookmark Manager links point to the bookmarks bar folder. (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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 cr.define('ntp4', function() { 5 cr.define('ntp4', function() {
6 'use strict'; 6 'use strict';
7 7
8 var localStrings = new LocalStrings; 8 var localStrings = new LocalStrings;
9 9
10 /** 10 /**
(...skipping 281 matching lines...) Expand 10 before | Expand all | Expand 10 after
292 * Build the bookmark tiles. 292 * Build the bookmark tiles.
293 * @param {Array} items The contents of the current folder. 293 * @param {Array} items The contents of the current folder.
294 * @private 294 * @private
295 */ 295 */
296 updateBookmarkTiles_: function(items) { 296 updateBookmarkTiles_: function(items) {
297 this.removeAllTiles(); 297 this.removeAllTiles();
298 var tile_count = Math.min(items.length, MAX_BOOKMARK_TILES); 298 var tile_count = Math.min(items.length, MAX_BOOKMARK_TILES);
299 for (var i = 0; i < tile_count; i++) 299 for (var i = 0; i < tile_count; i++)
300 this.appendTile(new Bookmark(items[i]), false); 300 this.appendTile(new Bookmark(items[i]), false);
301 301
302 var folder_id = this.id == ROOT_NODE_ID ? BOOKMARKS_BAR_ID : this.id;
302 var link = $('bookmarks-top-link-wrapper').querySelector('a'); 303 var link = $('bookmarks-top-link-wrapper').querySelector('a');
303 link.href = 'chrome://bookmarks/#' + this.id; 304 link.href = 'chrome://bookmarks/#' + folder_id;
304 305
305 var wrapper = $('bookmarks-bottom-link-wrapper'); 306 var wrapper = $('bookmarks-bottom-link-wrapper');
306 if (items.length > MAX_BOOKMARK_TILES) { 307 if (items.length > MAX_BOOKMARK_TILES) {
307 var link = wrapper.querySelector('a'); 308 var link = wrapper.querySelector('a');
Evan Stade 2011/09/21 22:13:23 confusing link variable shadowing here :(
csilv 2011/09/21 23:45:26 Indeed, fixed.
308 link.href = 'chrome://bookmarks/#' + this.id; 309 link.href = 'chrome://bookmarks/#' + folder_id;
309 wrapper.hidden = false; 310 wrapper.hidden = false;
310 } else { 311 } else {
311 wrapper.hidden = true; 312 wrapper.hidden = true;
312 } 313 }
313 314
314 if (this.id === ROOT_NODE_ID && !tile_count && !cr.isChromeOS) 315 if (this.id === ROOT_NODE_ID && !tile_count && !cr.isChromeOS)
315 this.showImportPromo_(); 316 this.showImportPromo_();
316 }, 317 },
317 318
318 /** 319 /**
(...skipping 314 matching lines...) Expand 10 before | Expand all | Expand 10 after
633 tile.stripeColor = color; 634 tile.stripeColor = color;
634 } 635 }
635 636
636 return { 637 return {
637 BookmarksPage: BookmarksPage, 638 BookmarksPage: BookmarksPage,
638 initBookmarkChevron: initBookmarkChevron, 639 initBookmarkChevron: initBookmarkChevron,
639 }; 640 };
640 }); 641 });
641 642
642 window.addEventListener('load', ntp4.initBookmarkChevron); 643 window.addEventListener('load', ntp4.initBookmarkChevron);
OLDNEW
« 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