summaryrefslogtreecommitdiffstats
path: root/chrome/browser
diff options
context:
space:
mode:
authorarv@chromium.org <arv@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-03-15 23:48:52 +0000
committerarv@chromium.org <arv@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-03-15 23:48:52 +0000
commitced6953a1ba5203dfbab30fa42c35702b45d3525 (patch)
treee2395e8832aa2fc14c14b6aa40aae590597478c6 /chrome/browser
parent7f46fac842053a49fa28c4e54ef087d9a056adf9 (diff)
downloadchromium_src-ced6953a1ba5203dfbab30fa42c35702b45d3525.zip
chromium_src-ced6953a1ba5203dfbab30fa42c35702b45d3525.tar.gz
chromium_src-ced6953a1ba5203dfbab30fa42c35702b45d3525.tar.bz2
Fix issue where search did not select the search tree item. This also fixes an issue with reloading after a search.
BUG=4890 TEST=Enter some search terms. Hitting enter should select the search tree item and show the search results. Noew, hit F5 to reload. The search term should be filled in and the search tree item should be selected and the search results should be shown. Review URL: http://codereview.chromium.org/837011 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@41656 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser')
-rw-r--r--chrome/browser/resources/bookmark_manager/main.html20
1 files changed, 12 insertions, 8 deletions
diff --git a/chrome/browser/resources/bookmark_manager/main.html b/chrome/browser/resources/bookmark_manager/main.html
index 7f275c0..11dd688 100644
--- a/chrome/browser/resources/bookmark_manager/main.html
+++ b/chrome/browser/resources/bookmark_manager/main.html
@@ -220,10 +220,7 @@ window.onhashchange = function(e) {
// 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 @@ list.addEventListener('urlClicked', function(e) {
* @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 @@ tree.addEventListener('load', function(e) {
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();