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

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

Issue 2639453002: [MD Bookmarks] Add Select for Bookmarks. (Closed)
Patch Set: fixed some comments Created 3 years, 10 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
index fbf620289cee192f48befad60703baa7cf24b511..3f8c87f5976d27ad5b129bdd967a7d816ee76f2f 100644
--- a/chrome/browser/resources/md_bookmarks/item.js
+++ b/chrome/browser/resources/md_bookmarks/item.js
@@ -13,17 +13,28 @@ 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,
@@ -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,
+ range: e.shiftKey,
+ add: e.ctrlKey,
+ });
+ },
+
+ /**
+ * @param {Event} e
+ * @private
+ */
+ onDblClick_: function(e) {
+ /* TODO(jiaxi): Add double click later. */
+ },
+
+ /**
+ * @param {string} 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