From 13e4ee1c31c87566d1c4c627c83f80473086c8fc Mon Sep 17 00:00:00 2001 From: Scott Main Date: Mon, 3 Oct 2011 15:37:36 -0700 Subject: [PATCH] docs: fix a bug in the search results in which clicking a sorting tab does not open that tab until you click a tab again. This occured due to the order of events being out of order in terms of when we invoke the click() on a tab based on the search being invoked. I'm pretty sure this worked fine before, so I think this might have been introduced by a behavior change in CSE. The fix is to simply invoke the click() for a tab when the respective search results actually return using an additional callback. Change-Id: Ib58fdc75b3095ca2a3a2f5f892e778acdbc1dacd --- docs/html/search.jd | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/docs/html/search.jd b/docs/html/search.jd index 339ce2ded35ca..407bc86b570b2 100644 --- a/docs/html/search.jd +++ b/docs/html/search.jd @@ -64,11 +64,14 @@ page.title=Search Results // upon ajax search, refresh the url and search title searchControl.setSearchStartingCallback(this, function(control, searcher, query) { + $("#searchTitle").html("search results for " + escapeHTML(query) + ""); + // save the tab index from the hash tabIndex = location.hash.split("&t=")[1]; - - $("#searchTitle").html("search results for " + escapeHTML(query) + ""); $.history.add('q=' + query + '&t=' + tabIndex); + }); + + searchControl.setSearchCompleteCallback(this, function(control, searcher) { openTab(); });