зеркало из https://github.com/mozilla/pjs.git
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:
Родитель
3e5b2792f9
Коммит
feec43698f
|
@ -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) {
|
||||
|
|
Загрузка…
Ссылка в новой задаче