Bug 127589: when switching tabs with find dialog open, update dialog's internal state so it's "attached" to the focused tab. r=Jan, sr=peterv

This commit is contained in:
jaggernaut%netscape.com 2006-09-14 06:06:44 +00:00
Родитель 0679c7657b
Коммит 0e2285ea7e
1 изменённых файлов: 13 добавлений и 10 удалений

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

@ -299,22 +299,25 @@ function BrowserSetForcedDetector(doReload)
BrowserReloadWithFlags(nsIWebNavigation.LOAD_FLAGS_CHARSET_CHANGE);
}
var gFindInstData;
function getFindInstData()
{
if (!gFindInstData) {
gFindInstData = new nsFindInstData();
gFindInstData.browser = getBrowser();
// defaults for rootSearchWindow and currentSearchWindow are fine here
}
return gFindInstData;
}
function BrowserFind()
{
var focusedWindow = document.commandDispatcher.focusedWindow;
if (!focusedWindow || focusedWindow == window)
focusedWindow = window._content;
findInPage(getBrowser(), window._content, focusedWindow)
findInPage(getFindInstData());
}
function BrowserFindAgain(reverse)
{
var focusedWindow = document.commandDispatcher.focusedWindow;
if (!focusedWindow || focusedWindow == window)
focusedWindow = window._content;
findAgainInPage(getBrowser(), window._content, focusedWindow, reverse)
findAgainInPage(getFindInstData(), reverse);
}
function BrowserCanFindAgain()