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

This commit is contained in:
blakeross%telocity.com 2002-04-29 03:00:57 +00:00
Родитель bf8e1a8bc6
Коммит 1235b35158
1 изменённых файлов: 9 добавлений и 2 удалений

Просмотреть файл

@ -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;