Bug 1564270 - Fix UI for setting a message's background image. r+a=jorgk
authorGeoff Lankow <geoff@darktrojan.net>
Wed, 10 Jul 2019 06:47:57 +0200
changeset 36056 75dffe1c92667a0b883fd6cc4b42aecc891bbb5d
parent 36055 1e6a4c2024e2054cc2e7ab6659189c5fc63a503f
child 36057 ae94e2a95a12a8b98d8ea0ae288434b6d6285788
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;
 }