Bug 1593280 - Follow-up: Restore setting of image attribute of menu items. r+a=me DONTBUILD
authorJorg K <jorgk@jorgk.com>
Wed, 06 Nov 2019 18:11:42 +0100
changeset 36388 162757dcb4cd49e973ce0282ec70adde85f22a84
parent 36387 31b98fe6d92329ed73e0c03cd373f20da3b27c7e
child 36389 9be1474307f448e3db3e564e6f3efb0a3b7957ef
push id2522
push usermozilla@jorgk.com
push dateWed, 06 Nov 2019 17:55:19 +0000
treeherdercomm-beta@162757dcb4cd [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1593280
Bug 1593280 - Follow-up: Restore setting of image attribute of menu items. r+a=me DONTBUILD
mail/components/compose/content/MsgComposeCommands.js
--- a/mail/components/compose/content/MsgComposeCommands.js
+++ b/mail/components/compose/content/MsgComposeCommands.js
@@ -1612,16 +1612,17 @@ function addAttachCloudMenuItems(aParent
     let iconURL = account.iconURL;
     item.cloudFileAccount = account;
     item.setAttribute(
       "label",
       cloudFileAccounts.getDisplayName(account) + "\u2026"
     );
     if (iconURL) {
       item.setAttribute("class", `${item.localName}-iconic`);
+      item.setAttribute("image", iconURL);
     }
     aParentMenu.appendChild(item);
 
     let previousUploads = account.getPreviousUploads();
     for (let upload of previousUploads) {
       let file = Cc["@mozilla.org/file/local;1"].createInstance(Ci.nsIFile);
       file.initWithPath(upload.path);
 
@@ -1630,16 +1631,17 @@ function addAttachCloudMenuItems(aParent
         continue;
       }
 
       let fileItem = document.createXULElement("menuitem");
       fileItem.cloudFileUpload = upload;
       fileItem.cloudFileAccount = account;
       fileItem.setAttribute("label", file.leafName);
       fileItem.setAttribute("class", "menuitem-iconic");
+      fileItem.setAttribute("image", "moz-icon://" + file.leafName);
       aParentMenu.appendChild(fileItem);
     }
   }
 }
 
 function addConvertCloudMenuItems(aParentMenu, aAfterNodeId, aRadioGroup) {
   let attachment = document.getElementById("attachmentBucket").selectedItem;
   let afterNode = document.getElementById(aAfterNodeId);
@@ -1664,16 +1666,17 @@ function addConvertCloudMenuItems(aParen
 
     if (
       attachment.cloudFileAccount &&
       attachment.cloudFileAccount.accountKey == account.accountKey
     ) {
       item.setAttribute("checked", "true");
     } else if (iconURL) {
       item.setAttribute("class", "menu-iconic");
+      item.setAttribute("image", iconURL);
     }
 
     aParentMenu.appendChild(item);
   }
 }
 
 async function uploadCloudAttachment(attachment, file, cloudFileAccount) {
   // Notify the UI that we're starting the upload process: disable send commands