OLD | NEW |
---|---|
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 279 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
290 link.href = 'chrome://bookmarks/#' + this.id; | 290 link.href = 'chrome://bookmarks/#' + this.id; |
291 | 291 |
292 var wrapper = $('bookmarks-bottom-link-wrapper'); | 292 var wrapper = $('bookmarks-bottom-link-wrapper'); |
293 if (items.length > MAX_BOOKMARK_TILES) { | 293 if (items.length > MAX_BOOKMARK_TILES) { |
294 var link = wrapper.querySelector('a'); | 294 var link = wrapper.querySelector('a'); |
295 link.href = 'chrome://bookmarks/#' + this.id; | 295 link.href = 'chrome://bookmarks/#' + this.id; |
296 wrapper.hidden = false; | 296 wrapper.hidden = false; |
297 } else { | 297 } else { |
298 wrapper.hidden = true; | 298 wrapper.hidden = true; |
299 } | 299 } |
300 | |
301 if (this.id === ROOT_NODE_ID && !tile_count) { | |
302 var importTemplate = $('bookmarks-import-data-link-wrapper'); | |
303 var importWrapper = importTemplate.cloneNode(true); | |
304 importWrapper.hidden = false; | |
305 this.querySelector('.tile-page-content').appendChild(importWrapper); | |
Evan Stade
2011/09/07 03:55:21
don't you need to remove it at some point (if the
csilv
2011/09/07 06:11:14
Yup, for add. Done.
| |
306 } | |
300 }, | 307 }, |
301 | 308 |
302 /** | 309 /** |
303 * Determine whether a bookmark ID matches a folder in the current | 310 * Determine whether a bookmark ID matches a folder in the current |
304 * hierarchy. | 311 * hierarchy. |
305 * @param {string} id The bookmark ID to search for. | 312 * @param {string} id The bookmark ID to search for. |
306 * @private | 313 * @private |
307 */ | 314 */ |
308 isBookmarkInParentHierarchy_: function(id) { | 315 isBookmarkInParentHierarchy_: function(id) { |
309 var titlesWrapper = $('bookmarks-title-wrapper'); | 316 var titlesWrapper = $('bookmarks-title-wrapper'); |
(...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
593 tile.stripeColor = color; | 600 tile.stripeColor = color; |
594 } | 601 } |
595 | 602 |
596 return { | 603 return { |
597 BookmarksPage: BookmarksPage, | 604 BookmarksPage: BookmarksPage, |
598 initBookmarkChevron: initBookmarkChevron, | 605 initBookmarkChevron: initBookmarkChevron, |
599 }; | 606 }; |
600 }); | 607 }); |
601 | 608 |
602 window.addEventListener('load', ntp4.initBookmarkChevron); | 609 window.addEventListener('load', ntp4.initBookmarkChevron); |
OLD | NEW |