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

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

Issue 2962923003: [MD Bookmarks] Add drag and drop indicator. (Closed)
Patch Set: 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
new file mode 100644
index 0000000000000000000000000000000000000000..41bd9426dba3e8f562413820a23bddf2b676b6b8
--- /dev/null
+++ b/chrome/browser/resources/md_bookmarks/dnd_chip.js
@@ -0,0 +1,44 @@
+// Copyright 2017 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-dnd-chip',
+
+ properties: {
+ /** @private */
+ showing_: {
+ type: Boolean,
+ reflectToAttribute: true,
+ },
+
+ /** @private */
+ isFolder_: Boolean,
+ },
+
+ /**
+ * @param {number} x
+ * @param {number} y
+ * @param {!Array<BookmarkNode>} items
+ */
+ showForItems: function(x, y, items) {
+ 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.$.title.textContent = firstItem.title;
+ this.showing_ = true;
+ },
+
+ hide: function() {
+ this.showing_ = false;
+ },
+});
« no previous file with comments | « chrome/browser/resources/md_bookmarks/dnd_chip.html ('k') | chrome/browser/resources/md_bookmarks/dnd_manager.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698