зеркало из https://github.com/mozilla/pjs.git
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:
Родитель
0679c7657b
Коммит
0e2285ea7e
|
@ -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()
|
||||
|
|
Загрузка…
Ссылка в новой задаче