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

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

Issue 2977523002: MD Bookmarks: Scroll and select items that are added to the main list (Closed)
Patch Set: Finish highlight on API callback 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_manager.js
diff --git a/chrome/browser/resources/md_bookmarks/dnd_manager.js b/chrome/browser/resources/md_bookmarks/dnd_manager.js
index c1a73839400886e8906400459932b78e08739b04..30cb1887a66f33ba42cb63f552d919bd133533ec 100644
--- a/chrome/browser/resources/md_bookmarks/dnd_manager.js
+++ b/chrome/browser/resources/md_bookmarks/dnd_manager.js
@@ -352,10 +352,18 @@ cr.define('bookmarks', function() {
e.preventDefault();
var dropInfo = this.calculateDropInfo_(this.dropDestination_);
- if (dropInfo.index != -1)
- chrome.bookmarkManagerPrivate.drop(dropInfo.parentId, dropInfo.index);
- else
- chrome.bookmarkManagerPrivate.drop(dropInfo.parentId);
+ var index = dropInfo.index != -1 ? dropInfo.index : undefined;
+ var shouldHighlight = isBookmarkItem(this.dropDestination_.element) ||
+ isBookmarkList(this.dropDestination_.element);
+
+ if (shouldHighlight)
+ bookmarks.ApiListener.trackUpdatedItems();
+
+ chrome.bookmarkManagerPrivate.drop(
+ dropInfo.parentId, index, function() {
calamity 2017/07/19 05:25:14 shouldHighlight ? bookmarks.ApiListener.highlightU
tsergeant 2017/07/19 06:53:12 Done.
+ if (shouldHighlight)
+ bookmarks.ApiListener.highlightUpdatedItems();
+ });
}
this.dropDestination_ = null;

Powered by Google App Engine
This is Rietveld 408576698