mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-01-19 01:10:22 +00:00
Fix bug # 18540: select the current search tab.
This commit is contained in:
parent
8d895265cb
commit
6be85367f4
@ -4,16 +4,19 @@ var gSearchStr = "";
|
||||
function loadPage(thePage, searchStr)
|
||||
{
|
||||
var content="", results="";
|
||||
var tabName="";
|
||||
|
||||
gSearchStr = "";
|
||||
|
||||
if (thePage == "find")
|
||||
{
|
||||
tabName="findTab";
|
||||
content="chrome://search/content/find.xul";
|
||||
results="chrome://search/content/findresults.xul";
|
||||
}
|
||||
else if (thePage == "internet")
|
||||
{
|
||||
tabName="internetTab";
|
||||
content="chrome://search/content/internet.xul";
|
||||
results="chrome://search/content/internetresults.xul";
|
||||
|
||||
@ -24,11 +27,13 @@ function loadPage(thePage, searchStr)
|
||||
}
|
||||
else if (thePage == "mail")
|
||||
{
|
||||
tabName="mailnewsTab";
|
||||
content="about:blank";
|
||||
results="about:blank";
|
||||
}
|
||||
else if (thePage == "addressbook")
|
||||
{
|
||||
tabName="addressbookTab";
|
||||
content="about:blank";
|
||||
results="about:blank";
|
||||
}
|
||||
@ -45,6 +50,11 @@ function loadPage(thePage, searchStr)
|
||||
{
|
||||
resultsFrame.setAttribute("src", results);
|
||||
}
|
||||
var theTab = document.getElementById(tabName);
|
||||
if (theTab)
|
||||
{
|
||||
theTab.setAttribute("selected", "true");
|
||||
}
|
||||
}
|
||||
return(true);
|
||||
}
|
||||
|
@ -31,10 +31,10 @@
|
||||
|
||||
<tabcontrol align="vertical">
|
||||
<tabbox align="horizontal">
|
||||
<tab selected="true" onclick="loadPage('find', null);">&find.title.label;</tab>
|
||||
<tab onclick="loadPage('internet', null);">&internet.title.label;</tab>
|
||||
<tab onclick="loadPage('mail', null);">&mailnews.title.label;</tab>
|
||||
<tab onclick="loadPage('addressbook', null);">&addressbook.title.label;</tab>
|
||||
<tab id="findTab" onclick="loadPage('find', null);">&find.title.label;</tab>
|
||||
<tab id="internetTab" onclick="loadPage('internet', null);">&internet.title.label;</tab>
|
||||
<tab id="mailnewsTab" onclick="loadPage('mail', null);">&mailnews.title.label;</tab>
|
||||
<tab id="addressbookTab" onclick="loadPage('addressbook', null);">&addressbook.title.label;</tab>
|
||||
<spring flex="1"/>
|
||||
</tabbox>
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user