Skip to content
This repository has been archived by the owner on Apr 10, 2024. It is now read-only.

Commit

Permalink
Bug 694084 - Showing/hiding the conditional forward button resizes th…
Browse files Browse the repository at this point in the history
…e search bar in a new profile (when the url/search bar splitter hasn't been used). r=gavin a=johnath
  • Loading branch information
daogottwald committed Jan 20, 2012
1 parent 3755ecf commit 22bf7ed
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions browser/base/content/browser.js
Expand Up @@ -1690,6 +1690,12 @@ function delayedStartup(isLoadingBlank, mustLoadSidebar) {


TabView.init(); TabView.init();


setUrlAndSearchBarWidthForConditionalForwardButton();
window.addEventListener("resize", function resizeHandler(event) {
if (event.target == window)
setUrlAndSearchBarWidthForConditionalForwardButton();
});

// Enable Inspector? // Enable Inspector?
let enabled = gPrefService.getBoolPref("devtools.inspector.enabled"); let enabled = gPrefService.getBoolPref("devtools.inspector.enabled");
if (enabled) { if (enabled) {
Expand Down Expand Up @@ -2613,6 +2619,24 @@ var LocationBarHelpers = {
} }
}; };


function setUrlAndSearchBarWidthForConditionalForwardButton() {
// Woraround for bug 694084: Showing/hiding the conditional forward button resizes
// the search bar when the url/search bar splitter hasn't been used.
var urlbarContainer = document.getElementById("urlbar-container");
var searchbarContainer = document.getElementById("search-container");
if (!urlbarContainer ||
!searchbarContainer ||
urlbarContainer.hasAttribute("width") ||
searchbarContainer.hasAttribute("width") ||
urlbarContainer.parentNode != searchbarContainer.parentNode)
return;
urlbarContainer.style.width = searchbarContainer.style.width = "";
var urlbarWidth = urlbarContainer.clientWidth;
var searchbarWidth = searchbarContainer.clientWidth;
urlbarContainer.style.width = urlbarWidth + "px";
searchbarContainer.style.width = searchbarWidth + "px";
}

function UpdatePageProxyState() function UpdatePageProxyState()
{ {
if (gURLBar && gURLBar.value != gLastValidURLStr) if (gURLBar && gURLBar.value != gLastValidURLStr)
Expand Down Expand Up @@ -3710,6 +3734,7 @@ function BrowserToolboxCustomizeDone(aToolboxChanged) {
// and the location bar are combined, so we need this ordering // and the location bar are combined, so we need this ordering
CombinedStopReload.init(); CombinedStopReload.init();
UpdateUrlbarSearchSplitterState(); UpdateUrlbarSearchSplitterState();
setUrlAndSearchBarWidthForConditionalForwardButton();


// Update the urlbar // Update the urlbar
if (gURLBar) { if (gURLBar) {
Expand Down

0 comments on commit 22bf7ed

Please sign in to comment.