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

Unified Diff: chrome/browser/resources/bookmark_manager/js/main.js

Issue 102713002: Support folders in bookmark search (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add test coverage and improve result refresh Created 7 years 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
« no previous file with comments | « chrome/browser/bookmarks/bookmark_utils.cc ('k') | chrome/test/data/extensions/api_test/bookmarks/test.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/bookmark_manager/js/main.js
diff --git a/chrome/browser/resources/bookmark_manager/js/main.js b/chrome/browser/resources/bookmark_manager/js/main.js
index d5e157fb5fb0758117cefaa7b93ad98fcba3c23e..8ff09857472e9e470fa84e5c88a4ec9eb82e1d2a 100644
--- a/chrome/browser/resources/bookmark_manager/js/main.js
+++ b/chrome/browser/resources/bookmark_manager/js/main.js
@@ -824,6 +824,19 @@ function openItem() {
}
/**
+ * Refreshes search results after delete or undo-delete.
+ * This ensures children of deleted folders do not remain in results
+ */
+function updateSearchResults() {
tfarina 2013/12/10 23:59:32 you need to get arv or dbeam to review the JS part
+ if (list.isSearch()) {
+ // Refresh search results
+ navigateTo(tree.items[0].id, updateHash);
+ $('term').focus();
arv (Not doing code reviews) 2013/12/11 16:41:38 This is not very nice. Why are we changing focus h
d.halman 2013/12/13 21:04:07 This was a somewhat hacky way to force search resu
+ setSearch($('term').value);
+ }
+}
+
+/**
* Deletes the selected bookmarks. The bookmarks are saved in memory in case
* the user needs to undo the deletion.
*/
@@ -845,6 +858,7 @@ function deleteBookmarks() {
// When all nodes have been saved, perform the deletion.
if (lastDeletedNodes.length === selectedIds.length)
performDelete();
+ updateSearchResults();
arv (Not doing code reviews) 2013/12/11 16:41:38 I don't understand this. Currently, if I'm deletin
d.halman 2013/12/13 21:04:07 I understand your other comments referring to upda
});
});
}
@@ -874,6 +888,8 @@ function restoreTree(node, parentId) {
node.children.forEach(function(child) {
restoreTree(child, result.id);
});
+
+ updateSearchResults();
arv (Not doing code reviews) 2013/12/11 16:41:38 This one I think is needed (undo delete does not u
d.halman 2013/12/13 21:04:07 Would there be an efficient way to check restored
arv (Not doing code reviews) 2013/12/13 22:08:14 Not at the moment AFIAK.
}
});
}
« no previous file with comments | « chrome/browser/bookmarks/bookmark_utils.cc ('k') | chrome/test/data/extensions/api_test/bookmarks/test.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698