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

Unified Diff: chrome/browser/resources/md_bookmarks/folder_node.js

Issue 2603303002: [MD Bookmarks] Add UI for Material Bookmarks. (Closed)
Patch Set: Created 3 years, 12 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 side-by-side diff with in-line comments
Download patch
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;
+ },
+});

Powered by Google App Engine
This is Rietveld 408576698