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

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

Issue 837011: Fix issue where search did not select the search tree item. This also fixes a... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 10 years, 9 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/bookmark_manager/main.html
===================================================================
--- chrome/browser/resources/bookmark_manager/main.html (revision 41461)
+++ chrome/browser/resources/bookmark_manager/main.html (working copy)
@@ -220,10 +220,7 @@
// In case we got a search hash update the text input and the bmm.treeLookup
// to use the new id.
if (/^q=/.test(id)) {
- delete bmm.treeLookup[searchTreeItem.bookmarkId];
- $('term').value = id.slice(2);
- searchTreeItem.bookmarkId = id;
- bmm.treeLookup[id] = searchTreeItem;
+ setSearch(id.slice(2));
valid = true;
} else if (id == 'recent') {
valid = true;
@@ -263,7 +260,10 @@
* @para {string} searchText The text to search for.
*/
function setSearch(searchText) {
- navigateTo('q=' + searchText);
+ delete bmm.treeLookup[searchTreeItem.bookmarkId];
+ searchTreeItem.bookmarkId = 'q=' + searchText;
+ bmm.treeLookup[searchTreeItem.bookmarkId] = searchTreeItem;
+ tree.selectedItem = searchTreeItem;
}
/**
@@ -390,9 +390,13 @@
hash = tree.items[0].bookmarkId;
}
- if (/^q=/.test(hash))
- $('term').value = hash.slice(2);
- navigateTo(hash);
+ if (/^q=/.test(hash)) {
+ var searchTerm = hash.slice(2);
+ $('term').value = searchTerm;
+ setSearch(searchTerm);
+ } else {
+ navigateTo(hash);
+ }
});
tree.buildTree();
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698