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

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

Issue 2972633002: [MD Bookmarks] Add UI for multi-item drag and drop chip. (Closed)
Patch Set: address comments Created 3 years, 5 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/dnd_chip.js
diff --git a/chrome/browser/resources/md_bookmarks/dnd_chip.js b/chrome/browser/resources/md_bookmarks/dnd_chip.js
index 41bd9426dba3e8f562413820a23bddf2b676b6b8..238aa35ba949ee139dbe6b0de94d31b82d0f0ecf 100644
--- a/chrome/browser/resources/md_bookmarks/dnd_chip.js
+++ b/chrome/browser/resources/md_bookmarks/dnd_chip.js
@@ -14,27 +14,31 @@ Polymer({
/** @private */
isFolder_: Boolean,
+
+ /** @private */
+ isMultiItem_: Boolean,
},
/**
* @param {number} x
* @param {number} y
* @param {!Array<BookmarkNode>} items
+ * @param {!BookmarkNode} dragItem
*/
- showForItems: function(x, y, items) {
+ showForItems: function(x, y, items, dragItem) {
this.style.setProperty('--mouse-x', x + 'px');
this.style.setProperty('--mouse-y', y + 'px');
if (this.showing_)
return;
- var firstItem = items[0];
- this.isFolder_ = !firstItem.url;
- // TODO(calamity): handle multi-item UI.
- if (firstItem.url)
- this.$.icon.style.backgroundImage = cr.icon.getFavicon(firstItem.url);
+ this.isFolder_ = !dragItem.url;
+ this.isMultiItem_ = items.length > 1;
+ if (dragItem.url)
+ this.$.icon.style.backgroundImage = cr.icon.getFavicon(dragItem.url);
- this.$.title.textContent = firstItem.title;
+ this.$.title.textContent = dragItem.title;
+ this.$.count.textContent = items.length;
this.showing_ = true;
},

Powered by Google App Engine
This is Rietveld 408576698