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

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

Issue 2972963003: MD Bookmarks: Prevent flash of folder contents when changing search term (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/util.js
diff --git a/chrome/browser/resources/md_bookmarks/util.js b/chrome/browser/resources/md_bookmarks/util.js
index 73b156a2a0d6c2417fc633300f2fcde751f580b3..3760bdea171d38001871b924b8bc8e5232cbaf29 100644
--- a/chrome/browser/resources/md_bookmarks/util.js
+++ b/chrome/browser/resources/md_bookmarks/util.js
@@ -14,10 +14,10 @@ cr.define('bookmarks.util', function() {
* @return {!Array<string>}
*/
function getDisplayedList(state) {
- if (!isShowingSearch(state))
- return assert(state.nodes[state.selectedFolder].children);
+ if (isShowingSearch(state))
+ return assert(state.search.results);
- return state.search.results;
+ return assert(state.nodes[state.selectedFolder].children);
}
/**
@@ -77,7 +77,7 @@ cr.define('bookmarks.util', function() {
search: {
term: '',
inProgress: false,
- results: [],
+ results: null,
},
selection: {
items: new Set(),
@@ -91,7 +91,7 @@ cr.define('bookmarks.util', function() {
* @return {boolean}
*/
function isShowingSearch(state) {
- return !!state.search.term && !state.search.inProgress;
+ return state.search.results != null;
}
/**
« no previous file with comments | « chrome/browser/resources/md_bookmarks/types.js ('k') | chrome/test/data/webui/md_bookmarks/reducers_test.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698