From 095ae24cdf4e49c2cd001e63b5f8951ef639c63e Mon Sep 17 00:00:00 2001 From: "blakeross%telocity.com" Date: Thu, 27 Jul 2006 14:55:45 +0000 Subject: [PATCH] 32034 - sidebar search fails if no navigator windows are open. r=bryner sr=ben --- suite/common/search/search-panel.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/suite/common/search/search-panel.js b/suite/common/search/search-panel.js index d69c5f8bc8f7..9d5dc471c285 100644 --- a/suite/common/search/search-panel.js +++ b/suite/common/search/search-panel.js @@ -675,10 +675,16 @@ function doStop() function doSearch() { - var searchMode = nsPreferences.getIntPref("browser.search.mode", 0); + var navWindow = getNavigatorWindow(true); + if (navWindow._content) + return onNavWindowLoad(); + navWindow.addEventListener("load", onNavWindowLoad, false); +} + +function onNavWindowLoad() { + var navWindow = getNavigatorWindow(true); // hide various columns - var navWindow = getNavigatorWindow(false); if (navWindow && "_content" in navWindow && "isMozillaSearchWindow" in navWindow._content) { colNode = navWindow._content.document.getElementById("RelevanceColumn"); if (colNode) @@ -701,6 +707,7 @@ function doSearch() return; } + var searchMode = nsPreferences.getIntPref("browser.search.mode", 0); var engineURIs = []; if (searchMode > 0) { var foundEngine = false;