Bug 1564270 - Fix UI for setting a message's background image. r+a=jorgk BETA_68_CONTINUATION
authorGeoff Lankow <geoff@darktrojan.net>
Wed, 10 Jul 2019 06:47:57 +0200
branchBETA_68_CONTINUATION
changeset 36066 1595c78e35881b6516a228e355f20405c7432ae6
parent 36065 26081cf14d0261b61044a8d4f5ea75569d5d2470
child 36067 3e28f14a9c2625831d8cc23143f410b67b5c8e21
push id392
push userclokep@gmail.com
push dateMon, 02 Sep 2019 20:17:19 +0000
bugs1564270
Bug 1564270 - Fix UI for setting a message's background image. r+a=jorgk
editor/ui/dialogs/content/EdColorProps.js
--- a/editor/ui/dialogs/content/EdColorProps.js
+++ b/editor/ui/dialogs/content/EdColorProps.js
@@ -390,30 +390,31 @@ function onAccept(event) {
   if (gBackgroundImage && /^file:/i.test(gBackgroundImage)) {
     let nsFile = Services.io.newURI(gBackgroundImage)
       .QueryInterface(Ci.nsIFileURL).file;
     if (nsFile.exists()) {
       let reader = new FileReader();
       reader.addEventListener("load", function() {
         gBackgroundImage = reader.result;
         gDialog.BackgroundImageInput.value = reader.result;
-        if (onAccept()) {
+        if (onAccept(event)) {
           window.close();
         }
       });
       File.createFromNsIFile(nsFile).then(file => {
         reader.readAsDataURL(file);
       });
       event.preventDefault(); // Don't close just yet...
-      return;
+      return false;
     }
   }
   if (ValidateData()) {
     // Copy attributes to element we are changing
     try {
       GetCurrentEditor().cloneAttributes(gBodyElement, globalElement);
     } catch (e) {}
 
     SaveWindowLocation();
-    return; // do close the window
+    return true; // do close the window
   }
   event.preventDefault();
+  return false;
 }