зеркало из https://github.com/mozilla/pjs.git
Fix bug # 23262: if the internet search window is currently open, give it focus (and select new tab if necessary).
This commit is contained in:
Родитель
6e6f060dc6
Коммит
9bbba6c7f2
|
@ -913,7 +913,20 @@ function OpenSearch(tabName, forceDialogFlag, searchStr)
|
|||
|
||||
if ((searchMode == 1) || (forceDialogFlag == true))
|
||||
{
|
||||
window.openDialog("chrome://search/content/search.xul", "SearchWindow", "dialog=no,close,chrome,resizable", tabName, searchStr);
|
||||
// Use a single search dialog
|
||||
var cwindowManager = Components.classes["component://netscape/rdf/datasource?name=window-mediator"].getService();
|
||||
var iwindowManager = Components.interfaces.nsIWindowMediator;
|
||||
var windowManager = cwindowManager.QueryInterface(iwindowManager);
|
||||
var searchWindow = windowManager.GetMostRecentWindow("search:window");
|
||||
if (searchWindow)
|
||||
{
|
||||
searchWindow.focus();
|
||||
if (searchWindow.loadPage) searchWindow.loadPage(tabName, searchStr);
|
||||
}
|
||||
else
|
||||
{
|
||||
window.openDialog("chrome://search/content/search.xul", "SearchWindow", "dialog=no,close,chrome,resizable", tabName, searchStr);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
<box align="horizontal" style="width: 100%;" >
|
||||
<spring align="horizontal" flex="100%" />
|
||||
|
||||
<titledbutton value="&search.label;" />
|
||||
<html:div>&search.label;</html:div>
|
||||
|
||||
<template id="categoryTemplate">
|
||||
<rule iscontainer="true">
|
||||
|
@ -38,7 +38,7 @@
|
|||
|
||||
</html:select>
|
||||
|
||||
<titledbutton value="&for.label;" />
|
||||
<html:div>&for.label;</html:div>
|
||||
<html:input id="searchtext" size="20" onkeyup="if (event.which == 13) { doSearch(); }" />
|
||||
<html:button id="searchbutton" onclick="return doSearch();">&search.button.label;</html:button>
|
||||
<html:button id="stopbutton" onclick="return doStop();" style="display: none;" >&stop.button.label;</html:button>
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
|
||||
var gSearchStr = "";
|
||||
var gTabName = "";
|
||||
|
||||
function loadPage(thePage, searchStr)
|
||||
{
|
||||
|
@ -38,6 +39,9 @@ function loadPage(thePage, searchStr)
|
|||
results="about:blank";
|
||||
}
|
||||
|
||||
if (tabName == gTabName) return(true);
|
||||
gTabName = tabName;
|
||||
|
||||
if ((content != "") && (results != ""))
|
||||
{
|
||||
var contentFrame = document.getElementById("content");
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
<!DOCTYPE window SYSTEM "chrome://search/locale/search.dtd">
|
||||
|
||||
<window id="search-window" title="&window.title.label;"
|
||||
class="dialog"
|
||||
class="dialog" windowtype="search:window"
|
||||
width="500" height="400" x="20" y="20" persist="width height x y" align="vertical"
|
||||
xmlns:html="http://www.w3.org/TR/REC-html40"
|
||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
|
|
Загрузка…
Ссылка в новой задаче