Bug 476814 - Unfork/Unify customizeToolbar.* and customizeToolbarSheet.*; Patch v1.0 Unfork OSX; r=mano

This commit is contained in:
Philip Chee 2009-02-16 16:27:20 +01:00
Родитель 6f5b6eb627
Коммит ca96b90531
2 изменённых файлов: 30 добавлений и 8 удалений

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

@ -45,11 +45,19 @@ var gToolbox = null;
var gCurrentDragOverItem = null;
var gToolboxChanged = false;
var gToolboxIconSize = false;
var gToolboxSheet = false;
function onLoad()
{
InitWithToolbox(window.arguments[0]);
repositionDialog();
if ("arguments" in window && window.arguments[0]) {
InitWithToolbox(window.arguments[0]);
repositionDialog();
}
else if (window.frameElement &&
"toolbox" in window.frameElement) {
gToolboxSheet = true;
InitWithToolbox(window.frameElement.toolbox);
}
}
function InitWithToolbox(aToolbox)
@ -68,6 +76,20 @@ function InitWithToolbox(aToolbox)
notifyParentInitialized();
}
function onClose()
{
if (!gToolboxSheet)
window.close();
else
finishToolbarCustomization();
}
function onUnload()
{
if (!gToolboxSheet)
finishToolbarCustomization();
}
function finishToolbarCustomization()
{
gToolbox.customizing = false;

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

@ -51,7 +51,7 @@
<window id="CustomizeToolbarWindow"
title="&dialog.title;"
onload="onLoad();"
onunload="finishToolbarCustomization();"
onunload="onUnload();"
style="&dialog.style;"
persist="width height"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
@ -61,10 +61,10 @@
<stringbundle id="stringBundle" src="chrome://global/locale/customizeToolbar.properties"/>
<keyset>
<key id="cmd_close_sheet" keycode="VK_ESCAPE" oncommand="window.close();"/>
<key id="cmd_close_sheet" keycode="VK_RETURN" oncommand="window.close();"/>
<key id="cmd_close_sheet" keycode="VK_ENTER" oncommand="window.close();"/>
<keyset id="CustomizeToolbarKeyset">
<key id="cmd_close1" keycode="VK_ESCAPE" oncommand="onClose();"/>
<key id="cmd_close2" keycode="VK_RETURN" oncommand="onClose();"/>
<key id="cmd_close3" keycode="VK_ENTER" oncommand="onClose();"/>
</keyset>
<vbox id="main-box" flex="1">
@ -96,7 +96,7 @@
<separator class="groove"/>
<hbox align="center" pack="end">
<button id="donebutton" label="&saveChanges.label;" oncommand="window.close();"
<button id="donebutton" label="&saveChanges.label;" oncommand="onClose();"
default="true" icon="close"/>
</hbox>
</vbox>