OLD | NEW |
---|---|
(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 /** @private */ | |
tsergeant
2017/01/03 23:31:17
@return annotation here and on the next function.
jiaxi
2017/01/04 02:50:16
Done.
| |
20 getFolderIcon_: function() { | |
21 return this.isSelected ? 'bookmarks:folder-open' : 'bookmarks:folder'; | |
22 }, | |
23 | |
24 /** @private */ | |
25 getArrowIcon_: function() { | |
26 return this.item.isOpen ? 'cr:arrow-drop-up' : 'cr:arrow-drop-down'; | |
tsergeant
2017/01/03 23:31:17
Did you deliberately leave out the change to cr_el
calamity
2017/01/04 00:43:00
Yeah, I'd rather not do all the settings stuff in
jiaxi
2017/01/04 02:50:16
Done.
jiaxi
2017/01/04 02:50:16
Done.
| |
27 }, | |
28 | |
29 /** @private */ | |
30 selectFolder_: function() { | |
31 this.fire('selected-folder-changed', this.item.id); | |
32 }, | |
33 | |
34 /** | |
35 * Occurs when the drop down arrow is tapped. | |
36 * @private | |
37 */ | |
38 toggleFolder_: function() { | |
39 this.fire('folder-open-changed', { | |
40 id: this.item.id, | |
41 open: !this.item.isOpen, | |
42 }); | |
43 }, | |
44 | |
45 /** @private */ | |
tsergeant
2017/01/03 23:31:17
@return annotation
jiaxi
2017/01/04 02:50:16
Done.
| |
46 hasChildFolder_: function() { | |
47 for (var i = 0; i < this.item.children.length; i++) { | |
48 if (!this.item.children[i].url) { | |
tsergeant
2017/01/03 23:31:17
Remove {}
jiaxi
2017/01/04 02:50:16
Done.
| |
49 return true; | |
50 } | |
51 } | |
52 return false; | |
53 }, | |
54 }); | |
OLD | NEW |