Bug 1695644 - Expand attachment pane when forwarding a message with multiple attachments. r=mkmelin a=rjl
authorAlessandro Castellani <alessandro@thunderbird.net>
Wed, 03 Mar 2021 12:55:41 +0200
changeset 41403 21e00b8f1c2dab872c64f5b7baf3e7cb4fe60d9e
parent 41402 170df637ae157ff01cbe2368714b82bd20b5278e
child 41404 1434f3f3e239661da0993c1f50b6fc78560793c3
push id3006
push userthunderbird@calypsoblue.org
push dateFri, 12 Mar 2021 00:30:52 +0000
treeherdercomm-beta@596432f495ed [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmkmelin, rjl
bugs1695644
Bug 1695644 - Expand attachment pane when forwarding a message with multiple attachments. r=mkmelin a=rjl
mail/components/compose/content/MsgComposeCommands.js
mail/themes/shared/mail/messengercompose.css
--- a/mail/components/compose/content/MsgComposeCommands.js
+++ b/mail/components/compose/content/MsgComposeCommands.js
@@ -140,18 +140,20 @@ var gEncryptedURIService = Cc[
 
 try {
   var gDragService = Cc["@mozilla.org/widget/dragservice;1"].getService(
     Ci.nsIDragService
   );
 } catch (e) {}
 
 // Temporarily store the height of the attachment container allowing users to
-// keep the resized height when toggling the attachment panel on and off.
-var kAttachmentHeight;
+// keep the resized height when toggling the attachment panel on and off. Set
+// a default value in order to properly run the condition against a new height
+// value when a message with multiple attachments is forwarded.
+var kAttachmentHeight = 0;
 
 // i18n globals
 var _gComposeBundle;
 function getComposeBundle() {
   // That one has to be lazy. Getting a reference to an element with a XBL
   // binding attached will cause the XBL constructors to fire if they haven't
   // already. If we get a reference to the compose bundle at script load-time,
   // this will cause the XBL constructor that's responsible for the personas to
@@ -6814,17 +6816,19 @@ function moveFocusToAttachmentPane() {
  * @param {Event} event - The DOM Event.
  */
 function onToggleAttachmentPane(event) {
   // Skip if it's not a left click.
   if (event.button != 0) {
     return;
   }
 
-  toggleAttachmentPane("toggle");
+  toggleAttachmentPane(
+    !document.getElementById("attachmentsBox").collapsed ? "hide" : "show"
+  );
 }
 
 function showReorderAttachmentsPanel() {
   // Ensure attachment pane visibility as it might be collapsed.
   toggleAttachmentPane("show");
   showPopupById(
     "reorderAttachmentsPanel",
     "attachmentBucket",
--- a/mail/themes/shared/mail/messengercompose.css
+++ b/mail/themes/shared/mail/messengercompose.css
@@ -238,17 +238,17 @@
 :root[lwt-tree] #attachmentView,
 :root[lwt-tree] #attachmentBucket {
   background-color: var(--toolbar-bgcolor) !important;
   background-image: none !important;
   color: var(--toolbar-color);
 }
 
 #attachmentToolbar {
-  margin: 6px 3px;
+  padding: 6px 3px;
 }
 
 #attachmentInfo {
   position: relative;
   display: flex;
   align-items: center;
 }