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

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

Issue 2639453002: [MD Bookmarks] Add Select for Bookmarks. (Closed)
Patch Set: some more clean up 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/item.js
diff --git a/chrome/browser/resources/md_bookmarks/item.js b/chrome/browser/resources/md_bookmarks/item.js
index 13e698245beb96e9f96eee2344a157b7aadb109e..97adcb2750c02727e7cefbd926f4710b25f4c2f0 100644
--- a/chrome/browser/resources/md_bookmarks/item.js
+++ b/chrome/browser/resources/md_bookmarks/item.js
@@ -13,20 +13,31 @@ Polymer({
},
isFolder_: Boolean,
+
+ isSelectedItem: {
+ type: Boolean,
+ reflectToAttribute: true,
+ },
},
observers: [
'updateFavicon_(item.url)',
],
+ listeners: {
+ 'click': 'onClick_',
+ 'dblclick': 'onDblClick_',
+ },
+
/**
* @param {Event} e
* @private
*/
- onMenuButtonOpenTap_: function(e) {
+ onMenuButtonOpenClick_: function(e) {
+ e.stopPropagation();
this.fire('open-item-menu', {
target: e.target,
- item: this.item
+ item: this.item,
});
},
@@ -35,7 +46,30 @@ Polymer({
this.isFolder_ = !(this.item.url);
},
- /** @private */
+ /**
+ * @param {Event} e
+ * @private
+ */
+ onClick_: function(e) {
+ this.fire('select-item', {
+ item: this.item,
+ shiftKey: e.shiftKey,
+ ctrlKey: e.ctrlKey,
+ });
+ },
+
+ /**
+ * @param {Event} e
+ * @private
+ */
+ onDblClick_: function(e) {
+ /* TODO(jiaxi): Add double click later. */
+ },
+
+ /**
+ * @param {Event} e
tsergeant 2017/01/25 06:02:13 This annotation is wrong
jiaxi 2017/01/30 03:28:58 Done.
+ * @private
+ */
updateFavicon_: function(url) {
this.$.icon.style.backgroundImage = cr.icon.getFavicon(url);
},

Powered by Google App Engine
This is Rietveld 408576698