mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-28 23:31:56 +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();
|
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) {
|
||||||
@ -2610,6 +2616,24 @@ function UpdateUrlbarSearchSplitterState()
|
|||||||
splitter.parentNode.removeChild(splitter);
|
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()
|
function UpdatePageProxyState()
|
||||||
{
|
{
|
||||||
if (gURLBar && gURLBar.value != gLastValidURLStr)
|
if (gURLBar && gURLBar.value != gLastValidURLStr)
|
||||||
@ -3735,6 +3759,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) {
|
||||||
|
Loading…
Reference in New Issue
Block a user