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

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

Issue 2603303002: [MD Bookmarks] Add UI for Material Bookmarks. (Closed)
Patch Set: fix 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 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..04249f9f986e6d04c53c0ec76ef597ef5a60d28b
--- /dev/null
+++ b/chrome/browser/resources/md_bookmarks/folder_node.js
@@ -0,0 +1,65 @@
+// 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
+ * @return {string}
+ */
+ getFolderIcon_: function() {
+ //TODO(jiaxi): Move these icons to shared file.
+ return this.isSelected ? 'bookmarks:folder-open' : 'bookmarks:folder';
+ },
+
+ /**
+ * @private
+ * @return {string}
+ */
+ getArrowIcon_: function() {
+ //TODO(jiaxi): Move these icons to shared file.
calamity 2017/01/04 04:33:07 // TODO But also, these TODOs should really be i
jiaxi 2017/01/04 04:41:31 Done.
+ return this.item.isOpen ? 'bookmarks:arrow-drop-up' :
+ 'bookmarks:arrow-drop-down';
+ },
+
+ /** @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
+ * @return {boolean}
+ */
+ hasChildFolder_: function() {
+ for (var i = 0; i < this.item.children.length; i++) {
+ if (!this.item.children[i].url)
+ return true;
+ }
+ return false;
+ },
+});
« 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