fix ctrl-m's

This commit is contained in:
scott%scott-macgregor.org 2003-12-14 21:27:55 +00:00
parent 1f1a132025
commit 2bccbe78d3
2 changed files with 53 additions and 53 deletions

View File

@ -58,37 +58,37 @@ function onUnload(aEvent)
notifyParentComplete();
}
function onCancel()
{
// restore the saved toolbarset for each customizeable toolbar
// Restore the defaultset for fixed toolbars.
var toolbar = gToolbox.firstChild;
while (toolbar) {
if (isCustomizableToolbar(toolbar)) {
if (!toolbar.hasAttribute("customindex")) {
var previousset = toolbar.getAttribute("previousset");
if (previousset)
{
toolbar.currentSet = previousset;
}
}
}
toolbar = toolbar.nextSibling;
}
// Now rebuild the palette.
buildPalette();
// Now re-wrap the items on the toolbar.
wrapToolbarItems();
repositionDialog();
gToolboxChanged = true;
return onAccept(); // we restored the default toolbar, act like a normal accept event now
}
function onCancel()
{
// restore the saved toolbarset for each customizeable toolbar
// Restore the defaultset for fixed toolbars.
var toolbar = gToolbox.firstChild;
while (toolbar) {
if (isCustomizableToolbar(toolbar)) {
if (!toolbar.hasAttribute("customindex")) {
var previousset = toolbar.getAttribute("previousset");
if (previousset)
{
toolbar.currentSet = previousset;
}
}
}
toolbar = toolbar.nextSibling;
}
// Now rebuild the palette.
buildPalette();
// Now re-wrap the items on the toolbar.
wrapToolbarItems();
repositionDialog();
gToolboxChanged = true;
return onAccept(); // we restored the default toolbar, act like a normal accept event now
}
function onAccept(aEvent)
{
@ -220,9 +220,9 @@ function wrapToolbarItems()
{
for (var i = 0; i < gToolbox.childNodes.length; ++i) {
var toolbar = getToolbarAt(i);
if (isCustomizableToolbar(toolbar)) {
// save off the current set for each toolbar in case the user hits cancel
toolbar.setAttribute('previousset', toolbar.currentSet);
if (isCustomizableToolbar(toolbar)) {
// save off the current set for each toolbar in case the user hits cancel
toolbar.setAttribute('previousset', toolbar.currentSet);
for (var k = 0; k < toolbar.childNodes.length; ++k) {
var item = toolbar.childNodes[k];
@ -247,7 +247,7 @@ function wrapToolbarItems()
{
for (var i = 0; i < gToolbox.childNodes.length; ++i) {
var toolbar = getToolbarAt(i);
if (isCustomizableToolbar(toolbar)) {
if (isCustomizableToolbar(toolbar)) {
toolbar.removeAttribute('previousset'); // remove previous set attribute
for (var k = 0; k < toolbar.childNodes.length; ++k) {
var paletteItem = toolbar.childNodes[k];

View File

@ -34,18 +34,18 @@
<?xml-stylesheet href="chrome://messenger/skin/messengercompose/messengercompose.css" type="text/css"?>
<?xml-stylesheet href="chrome://messenger/skin/smime/msgCompSMIMEOverlay.css" type="text/css"?>
<?xml-stylesheet href="chrome://messenger/skin/primaryToolbar.css" type="text/css"?>
#ifndef XP_MACOSX
<dialog id="CustomizeToolbarWindow"
#else
<window id="CustomizeToolbarWindow" onclose="onAccept(); return false;"
#endif
#ifndef XP_MACOSX
<dialog id="CustomizeToolbarWindow"
#else
<window id="CustomizeToolbarWindow" onclose="onAccept(); return false;"
#endif
title="&dialog.title;"
onload="onLoad();"
onunload="onUnload();"
buttons="accept,cancel"
ondialogaccept="return onAccept();"
onunload="onUnload();"
buttons="accept,cancel"
ondialogaccept="return onAccept();"
ondialogcancel="return onCancel();"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
@ -80,16 +80,16 @@
<button label="&restoreDefaultSet.label;" oncommand="restoreDefaultSet();"/>
</box>
<separator class="groove"/>
#ifdef XP_MACOSX
<hbox align="center" pack="end">
<button label="&saveChanges.label;" oncommand="onAccept();" default="true"/>
</hbox>
<separator class="groove"/>
#ifdef XP_MACOSX
<hbox align="center" pack="end">
<button label="&saveChanges.label;" oncommand="onAccept();" default="true"/>
</hbox>
#endif
</vbox>
#ifndef XP_MACOSX
</dialog>
#else
</window>
#ifndef XP_MACOSX
</dialog>
#else
</window>
#endif