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

Unified Diff: chrome/browser/resources/md_bookmarks/item.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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/resources/md_bookmarks/item.html ('k') | chrome/browser/resources/md_bookmarks/list.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/md_bookmarks/item.js
diff --git a/chrome/browser/resources/md_bookmarks/item.js b/chrome/browser/resources/md_bookmarks/item.js
new file mode 100644
index 0000000000000000000000000000000000000000..6558615f268f422d64af33cafd3ff545c1647236
--- /dev/null
+++ b/chrome/browser/resources/md_bookmarks/item.js
@@ -0,0 +1,41 @@
+// 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-item',
+
+ properties: {
+ /** @type {BookmarkTreeNode} */
+ item: {
+ type: Object,
+ observer: 'onItemChanged_'
+ },
+
+ isFolder_: Boolean,
+ },
+
+ observers: [
+ 'updateFavicon_(item.url)'
+ ],
+
+ /**
+ * @param {Event} e
+ * @private
+ */
+ onMenuButtonOpenTap_: function(e) {
+ this.fire('toggle-menu', {
+ target: e.target
+ });
+ },
+
+ /** @private */
+ onItemChanged_: function() {
+ this.isFolder_ = !(this.item.url);
+ },
+
+ /** @private */
+ updateFavicon_: function(url) {
+ this.$.icon.style.backgroundImage = cr.icon.getFavicon(url);
+ }
+});
« no previous file with comments | « chrome/browser/resources/md_bookmarks/item.html ('k') | chrome/browser/resources/md_bookmarks/list.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698