Bug 395122 - Toolbar customization sheet is broken. r+a=mconnor.

This commit is contained in:
mozilla.mano@sent.com 2007-09-06 17:59:29 -07:00
Родитель f279454594
Коммит aca0ca1775
2 изменённых файлов: 36 добавлений и 51 удалений

Просмотреть файл

@ -3024,23 +3024,13 @@ function BrowserCustomizeToolbar()
cmd.setAttribute("disabled", "true");
#ifdef TOOLBAR_CUSTOMIZATION_SHEET
document.getElementById("customizeToolbarSheetBox").hidden = false;
/**
* XXXmano hack: when a new tab is added while the sheet is visible,
* the new tabpanel is overlaying the sheet. We workaround this issue by
* hiding and reopening the sheet when a new tab is added.
*/
function TabOpenSheetHandler(aEvent) {
getBrowser().removeEventListener("TabOpen", TabOpenSheetHandler, false);
document.getElementById("customizeToolbarSheetIFrame")
.contentWindow.gCustomizeToolbarSheet.done();
document.getElementById("customizeToolbarSheetBox").hidden = true;
BrowserCustomizeToolbar();
}
getBrowser().addEventListener("TabOpen", TabOpenSheetHandler, false);
var sheetFrame = document.getElementById("customizeToolbarSheetIFrame");
sheetFrame.hidden = false;
// XXXmano: there's apparently no better way to get this when the iframe is
// hidden
var sheetWidth = sheetFrame.style.width.match(/([0-9]+)px/)[1];
document.getElementById("customizeToolbarSheetPopup")
.openPopup(getNavToolbox(), "after_start", (window.innerWidth - sheetWidth) / 2, 0);
#else
window.openDialog("chrome://global/content/customizeToolbar.xul",
"CustomizeToolbar",
@ -3052,7 +3042,8 @@ function BrowserCustomizeToolbar()
function BrowserToolboxCustomizeDone(aToolboxChanged)
{
#ifdef TOOLBAR_CUSTOMIZATION_SHEET
document.getElementById("customizeToolbarSheetBox").hidden = true;
document.getElementById("customizeToolbarSheetIFrame").hidden = true;
document.getElementById("customizeToolbarSheetPopup").hidePopup();
#endif
// Update global UI elements that may have been added or removed

Просмотреть файл

@ -448,42 +448,36 @@
customizable="true"/>
</toolbox>
<stack id="browser-stack" flex="1">
<hbox flex="1" id="browser">
<vbox id="sidebar-box" hidden="true" class="chromeclass-extrachrome">
<sidebarheader align="center">
<label id="sidebar-title" persist="value" flex="1" crop="end" control="sidebar"/>
<image id="sidebar-throbber"/>
<toolbarbutton class="tabs-closebutton" tooltiptext="&sidebarCloseButton.tooltip;" oncommand="toggleSidebar();"/>
</sidebarheader>
<browser id="sidebar" flex="1" autoscroll="false"
style="min-width: 14em; width: 18em; max-width: 36em;"/>
</vbox>
<hbox flex="1" id="browser">
<vbox id="sidebar-box" hidden="true" class="chromeclass-extrachrome">
<sidebarheader align="center">
<label id="sidebar-title" persist="value" flex="1" crop="end" control="sidebar"/>
<image id="sidebar-throbber"/>
<toolbarbutton class="tabs-closebutton" tooltiptext="&sidebarCloseButton.tooltip;" oncommand="toggleSidebar();"/>
</sidebarheader>
<browser id="sidebar" flex="1" autoscroll="false"
style="min-width: 14em; width: 18em; max-width: 36em;"/>
</vbox>
<splitter id="sidebar-splitter" class="chromeclass-extrachrome" hidden="true"/>
<vbox id="appcontent" flex="1">
<tabbrowser id="content" disablehistory="true"
flex="1" contenttooltip="aHTMLTooltip"
contentcontextmenu="contentAreaContextMenu"
onnewtab="BrowserOpenTab();"
autocompletepopup="PopupAutoComplete"
ondragdrop="nsDragAndDrop.drop(event, contentAreaDNDObserver);"
onclick="return contentAreaClick(event, false);"/>
</vbox>
</hbox>
<splitter id="sidebar-splitter" class="chromeclass-extrachrome" hidden="true"/>
<vbox id="appcontent" flex="1">
<tabbrowser id="content" disablehistory="true"
flex="1" contenttooltip="aHTMLTooltip"
contentcontextmenu="contentAreaContextMenu"
onnewtab="BrowserOpenTab();"
autocompletepopup="PopupAutoComplete"
ondragdrop="nsDragAndDrop.drop(event, contentAreaDNDObserver);"
onclick="return contentAreaClick(event, false);"/>
</vbox>
</hbox>
#ifdef TOOLBAR_CUSTOMIZATION_SHEET
<hbox flex="1" hidden="true" id="customizeToolbarSheetBox">
<hbox flex="1"/>
<vbox flex="1">
<iframe id="customizeToolbarSheetIFrame"
style="&dialog.style;"
src="chrome://global/content/customizeToolbar.xul"/>
<vbox flex="1"/>
</vbox>
<hbox flex="1"/>
</hbox>
<panel id="customizeToolbarSheetPopup" noautohide="true">
<iframe id="customizeToolbarSheetIFrame"
style="&dialog.style;"
src="chrome://global/content/customizeToolbar.xul"
hidden="true"/>
</panel>
#endif
</stack>
<findbar browserid="content" id="FindToolbar"/>