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

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

Issue 2946203002: MD Bookmarks: Batch updates to the UI when processing deletes and moves (Closed)
Patch Set: Created 3 years, 6 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 71b1bcde1da76d1ec6d9c480ed6bf02d73021274..f742ad9de40f4a32e90bec173578e43d89ea7cb2 100644
--- a/chrome/browser/resources/md_bookmarks/dnd_manager.js
+++ b/chrome/browser/resources/md_bookmarks/dnd_manager.js
@@ -336,10 +336,13 @@ 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 store = bookmarks.Store.getInstance();
+ store.beginBatchUpdate();
+ chrome.bookmarkManagerPrivate.drop(
calamity 2017/06/22 05:48:27 This works within the BMM, but moving a folder in
tsergeant 2017/06/23 00:20:20 Hmmm, good idea, but I'm not sure that this is pos
calamity 2017/06/26 03:17:24 Hmm. How about just batching in api_listener.js? H
tsergeant 2017/06/27 07:35:53 Done. As discussed, I setTimeout seems to work rel
+ dropInfo.parentId, index, function() {
+ store.endBatchUpdate();
+ });
}
this.dropDestination_ = null;
« no previous file with comments | « chrome/browser/resources/md_bookmarks/command_manager.js ('k') | chrome/browser/resources/md_bookmarks/store.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698