diff --git a/mail/base/content/customizeToolbar.js b/mail/base/content/customizeToolbar.js index a0521dce613d..c6aeb724b3ea 100644 --- a/mail/base/content/customizeToolbar.js +++ b/mail/base/content/customizeToolbar.js @@ -26,6 +26,7 @@ const kWindowWidth = 600; const kWindowHeight = 400; const kAnimateIncrement = 50; const kAnimateSteps = kWindowHeight / kAnimateIncrement - 1; +const kVSizeSlop = 5; var gToolboxDocument = null; var gToolbox = null; @@ -41,13 +42,9 @@ function onLoad() gToolbox.addEventListener("dragover", onToolbarDragOver, false); gToolbox.addEventListener("dragexit", onToolbarDragExit, false); gToolbox.addEventListener("dragdrop", onToolbarDragDrop, false); - - document.documentElement.setAttribute("hidechrome", "true"); - repositionDialog(); - window.outerWidth = kWindowWidth; - window.outerHeight = 50; - slideOpen(0); + + initDialog(); } function onUnload(aEvent) @@ -57,6 +54,8 @@ function onUnload(aEvent) persistCurrentSets(); notifyParentComplete(); + + window.close(); } function onCancel() @@ -93,7 +92,7 @@ function onCancel() function onAccept(aEvent) { document.getElementById("main-box").collapsed = true; - slideClosed(0); + window.close(); } function initDialog() @@ -116,31 +115,20 @@ function initDialog() wrapToolbarItems(); } -function slideOpen(aStep) -{ - if (aStep < kAnimateSteps) { - window.outerHeight += kAnimateIncrement; - setTimeout(slideOpen, 20, ++aStep); - } else { - initDialog(); - } -} - -function slideClosed(aStep) -{ - if (aStep < kAnimateSteps) { - window.outerHeight -= kAnimateIncrement; - setTimeout(slideClosed, 10, ++aStep); - } else { - window.close(); - } -} - function repositionDialog() { - // Position the dialog touching the bottom of the toolbox and centered with it + // Position the dialog touching the bottom of the toolbox and centered with + // it. We must resize the window smaller first so that it is positioned + // properly. var screenX = gToolbox.boxObject.screenX + ((gToolbox.boxObject.width - kWindowWidth) / 2); var screenY = gToolbox.boxObject.screenY + gToolbox.boxObject.height; + + var newHeight = kWindowHeight; + if (newHeight >= screen.availHeight - screenY - kVSizeSlop) { + newHeight = screen.availHeight - screenY - kVSizeSlop; + } + + window.resizeTo(kWindowWidth, newHeight); window.moveTo(screenX, screenY); } diff --git a/mail/base/content/customizeToolbar.xul b/mail/base/content/customizeToolbar.xul index e8c99a8b2118..85689247110f 100644 --- a/mail/base/content/customizeToolbar.xul +++ b/mail/base/content/customizeToolbar.xul @@ -55,6 +55,12 @@ + + + + + + &instructions.description;