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

Side by Side Diff: chrome/browser/resources/md_bookmarks/folder_node.js

Issue 2603303002: [MD Bookmarks] Add UI for Material Bookmarks. (Closed)
Patch Set: change TODO position Created 3 years, 11 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
OLDNEW
(Empty)
1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 Polymer({
6 is: 'bookmarks-folder-node',
7
8 properties: {
9 /** @type {BookmarkTreeNode} */
10 item: Object,
11
12 isSelected: {
13 type: Boolean,
14 value: false,
15 reflectToAttribute: true,
16 },
17 },
18
19 /**
20 * @private
21 * @return {string}
22 */
23 getFolderIcon_: function() {
24 return this.isSelected ? 'bookmarks:folder-open' : 'bookmarks:folder';
25 },
26
27 /**
28 * @private
29 * @return {string}
30 */
31 getArrowIcon_: function() {
32 return this.item.isOpen ? 'bookmarks:arrow-drop-up' :
33 'bookmarks:arrow-drop-down';
34 },
35
36 /** @private */
37 selectFolder_: function() {
38 this.fire('selected-folder-changed', this.item.id);
39 },
40
41 /**
42 * Occurs when the drop down arrow is tapped.
43 * @private
44 */
45 toggleFolder_: function() {
46 this.fire('folder-open-changed', {
47 id: this.item.id,
48 open: !this.item.isOpen,
49 });
50 },
51
52 /**
53 * @private
54 * @return {boolean}
55 */
56 hasChildFolder_: function() {
57 for (var i = 0; i < this.item.children.length; i++) {
58 if (!this.item.children[i].url)
59 return true;
60 }
61 return false;
62 },
63 });
OLDNEW
« no previous file with comments | « chrome/browser/resources/md_bookmarks/folder_node.html ('k') | chrome/browser/resources/md_bookmarks/icons.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698