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

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

Issue 2746363013: [MD Bookmarks] Add a drag and drop indicator to bookmarks. (Closed)
Patch Set: fix nit Created 3 years, 9 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/folder_node.js
diff --git a/chrome/browser/resources/md_bookmarks/folder_node.js b/chrome/browser/resources/md_bookmarks/folder_node.js
index ff0f867a50c79ad0045c1366287a7531ca5d54c2..40fb4a9db70188c90ac1882cdc4869b27e23b477 100644
--- a/chrome/browser/resources/md_bookmarks/folder_node.js
+++ b/chrome/browser/resources/md_bookmarks/folder_node.js
@@ -38,6 +38,7 @@ Polymer({
},
},
+ /** @override */
attached: function() {
this.watch('item_', function(state) {
return state.nodes[this.itemId];
@@ -52,6 +53,11 @@ Polymer({
this.updateFromStore();
},
+ /** @return {HTMLElement} */
+ getDropTarget: function() {
+ return this.$.container;
+ },
+
/**
* @private
* @return {string}
@@ -91,11 +97,7 @@ Polymer({
* @return {boolean}
*/
hasChildFolder_: function() {
- for (var i = 0; i < this.item_.children.length; i++) {
- if (this.isFolder_(this.item_.children[i]))
- return true;
- }
- return false;
+ return bookmarks.util.hasChildFolders(this.itemId, this.getState().nodes);
},
/** @private */
@@ -118,5 +120,13 @@ Polymer({
*/
isFolder_: function(itemId) {
return !this.getState().nodes[itemId].url;
- }
+ },
+
+ /**
+ * @private
+ * @return {boolean}
+ */
+ isRootFolder_: function() {
+ return this.depth == 0;
+ },
});
« no previous file with comments | « chrome/browser/resources/md_bookmarks/folder_node.html ('k') | chrome/browser/resources/md_bookmarks/item.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698