Fix 184801 - home button tooltip not updated when changing home page in preferences

git-svn-id: svn://10.0.0.236/trunk@144492 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
blakeross%telocity.com
2003-07-06 04:33:16 +00:00
parent f840fd0be7
commit 3dfd269094
3 changed files with 18 additions and 1 deletions

View File

@@ -2878,6 +2878,7 @@ function updateHomeTooltip()
var homeButton = document.getElementById("home-button");
if (homeButton) {
var homePage = getHomePage();
homePage = homePage.replace(/\|/g,', ');
homeButton.setAttribute("tooltiptext", homePage);
}
}

View File

@@ -83,6 +83,21 @@ function setHomePageToDefaultPage()
homePageField.value = url;
}
function onOK() {
if (!('homepage' in parent)) return;
// Replace pipes with commas to look nicer.
parent.homepage = parent.homepage.replace(/\|/g,', ');
try {
// Update the home button tooltip.
top.opener.document.getElementById("home-button").setAttribute("tooltiptext", parent.homepage);
}
catch(ex) {
// Maybe we opened prefs from somewhere else
}
}
function Startup()
{
if (top.opener) {
@@ -94,5 +109,6 @@ function Startup()
useButton.label = useButton.getAttribute("label2");
}
}
parent.hPrefWindow.registerOKCallbackFunc(onOK);
}

View File

@@ -201,7 +201,7 @@
<hbox align="center" flex="1">
<label value="&location.label;" accesskey="&location.accesskey;" control="browserStartupHomepage"/>
<textbox id="browserStartupHomepage" type="autocomplete" class="padded" flex="1"
autocompletesearch="history"
autocompletesearch="history" oninput="parent.homepage = this.value;"
preftype="localizedstring"
prefstring="browser.startup.homepage"/> <!-- we may wish to change this to data
when we support fancy formatted local filenames -->