32034 - sidebar search fails if no navigator windows are open. r=bryner sr=ben

This commit is contained in:
blakeross%telocity.com 2006-07-27 14:55:45 +00:00
parent 3246371a97
commit 095ae24cdf

View File

@ -675,10 +675,16 @@ function doStop()
function doSearch() 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 // hide various columns
var navWindow = getNavigatorWindow(false);
if (navWindow && "_content" in navWindow && "isMozillaSearchWindow" in navWindow._content) { if (navWindow && "_content" in navWindow && "isMozillaSearchWindow" in navWindow._content) {
colNode = navWindow._content.document.getElementById("RelevanceColumn"); colNode = navWindow._content.document.getElementById("RelevanceColumn");
if (colNode) if (colNode)
@ -701,6 +707,7 @@ function doSearch()
return; return;
} }
var searchMode = nsPreferences.getIntPref("browser.search.mode", 0);
var engineURIs = []; var engineURIs = [];
if (searchMode > 0) { if (searchMode > 0) {
var foundEngine = false; var foundEngine = false;