| 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 a8e70f05ac6bcec86189b8e146f55061a610c8e9..c6e4c001bb3dd5a383d57a152a4e86442ab91797 100644
|
| --- a/chrome/browser/resources/md_bookmarks/util.js
|
| +++ b/chrome/browser/resources/md_bookmarks/util.js
|
| @@ -8,12 +8,14 @@
|
|
|
| cr.define('bookmarks.util', function() {
|
| /**
|
| + * Returns the list of bookmark IDs to be displayed in the UI, taking into
|
| + * account search and the currently selected folder.
|
| * @param {!BookmarksPageState} state
|
| * @return {!Array<string>}
|
| */
|
| function getDisplayedList(state) {
|
| if (!isShowingSearch(state))
|
| - return assert(state.nodes[assert(state.selectedFolder)].children);
|
| + return assert(state.nodes[state.selectedFolder].children);
|
|
|
| return state.search.results;
|
| }
|
| @@ -82,10 +84,10 @@ cr.define('bookmarks.util', function() {
|
|
|
| /**
|
| * @param {BookmarksPageState} state
|
| - * @return boolean
|
| + * @return {boolean}
|
| */
|
| function isShowingSearch(state) {
|
| - return !state.selectedFolder;
|
| + return !!state.search.term && !state.search.inProgress;
|
| }
|
|
|
| /**
|
|
|