Permalink
Browse files

Bug 694084 - Showing/hiding the conditional forward button resizes th…

…e search bar in a new profile (when the url/search bar splitter hasn't been used). r=gavin a=johnath
  • Loading branch information...
1 parent 3755ecf commit 22bf7ed4cc5c548210f99a08f884b89e6455034b Dão Gottwald committed Jan 20, 2012
Showing with 25 additions and 0 deletions.
  1. +25 −0 browser/base/content/browser.js
@@ -1690,6 +1690,12 @@ function delayedStartup(isLoadingBlank, mustLoadSidebar) {
TabView.init();
+ setUrlAndSearchBarWidthForConditionalForwardButton();
+ window.addEventListener("resize", function resizeHandler(event) {
+ if (event.target == window)
+ setUrlAndSearchBarWidthForConditionalForwardButton();
+ });
+
// Enable Inspector?
let enabled = gPrefService.getBoolPref("devtools.inspector.enabled");
if (enabled) {
@@ -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()
{
if (gURLBar && gURLBar.value != gLastValidURLStr)
@@ -3710,6 +3734,7 @@ function BrowserToolboxCustomizeDone(aToolboxChanged) {
// and the location bar are combined, so we need this ordering
CombinedStopReload.init();
UpdateUrlbarSearchSplitterState();
+ setUrlAndSearchBarWidthForConditionalForwardButton();
// Update the urlbar
if (gURLBar) {

0 comments on commit 22bf7ed

Please sign in to comment.