mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-25 05:41:12 +00:00
Bug 694084 - Showing/hiding the conditional forward button resizes the search bar in a new profile (when the url/search bar splitter hasn't been used). r=gavin
This commit is contained in:
parent
bb817daa90
commit
07793fbbed
@ -1701,6 +1701,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) {
|
||||
@ -2610,6 +2616,24 @@ function UpdateUrlbarSearchSplitterState()
|
||||
splitter.parentNode.removeChild(splitter);
|
||||
}
|
||||
|
||||
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)
|
||||
@ -3735,6 +3759,7 @@ function BrowserToolboxCustomizeDone(aToolboxChanged) {
|
||||
// and the location bar are combined, so we need this ordering
|
||||
CombinedStopReload.init();
|
||||
UpdateUrlbarSearchSplitterState();
|
||||
setUrlAndSearchBarWidthForConditionalForwardButton();
|
||||
|
||||
// Update the urlbar
|
||||
if (gURLBar) {
|
||||
|
Loading…
Reference in New Issue
Block a user