Index: chrome/browser/resources/md_bookmarks/folder_node.js |
diff --git a/chrome/browser/resources/md_bookmarks/folder_node.js b/chrome/browser/resources/md_bookmarks/folder_node.js |
new file mode 100644 |
index 0000000000000000000000000000000000000000..978749f173bec113126e964840ec0cb579723d36 |
--- /dev/null |
+++ b/chrome/browser/resources/md_bookmarks/folder_node.js |
@@ -0,0 +1,54 @@ |
+// Copyright 2016 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+Polymer({ |
+ is: 'bookmarks-folder-node', |
+ |
+ properties: { |
+ /** @type {BookmarkTreeNode} */ |
+ item: Object, |
+ |
+ isSelected: { |
+ type: Boolean, |
+ value: false, |
+ reflectToAttribute: true, |
+ }, |
+ }, |
+ |
+ /** @private */ |
tsergeant
2017/01/03 23:31:17
@return annotation here and on the next function.
jiaxi
2017/01/04 02:50:16
Done.
|
+ getFolderIcon_: function() { |
+ return this.isSelected ? 'bookmarks:folder-open' : 'bookmarks:folder'; |
+ }, |
+ |
+ /** @private */ |
+ getArrowIcon_: function() { |
+ 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.
|
+ }, |
+ |
+ /** @private */ |
+ selectFolder_: function() { |
+ this.fire('selected-folder-changed', this.item.id); |
+ }, |
+ |
+ /** |
+ * Occurs when the drop down arrow is tapped. |
+ * @private |
+ */ |
+ toggleFolder_: function() { |
+ this.fire('folder-open-changed', { |
+ id: this.item.id, |
+ open: !this.item.isOpen, |
+ }); |
+ }, |
+ |
+ /** @private */ |
tsergeant
2017/01/03 23:31:17
@return annotation
jiaxi
2017/01/04 02:50:16
Done.
|
+ hasChildFolder_: function() { |
+ for (var i = 0; i < this.item.children.length; i++) { |
+ if (!this.item.children[i].url) { |
tsergeant
2017/01/03 23:31:17
Remove {}
jiaxi
2017/01/04 02:50:16
Done.
|
+ return true; |
+ } |
+ } |
+ return false; |
+ }, |
+}); |