Bug 661289 - Scratchpad Save File prompts to overwrite existing files twice.; r=rcampbell
authorPavel Cvrcek <pcvrcek@mozilla.cz>
Thu, 11 Aug 2011 11:12:24 -0300
changeset 74306 4d97114b4e602d5049a2f639a3087c88648be84e
parent 74305 f803e527662ba9b22c45b767c6bd7e64ec00c70c
child 74307 94f632be4b201c1425d8bcca25ba15c4393fa4e3
push id2
push userbsmedberg@mozilla.com
push dateFri, 19 Aug 2011 14:38:13 +0000
reviewersrcampbell
bugs661289
milestone8.0a1
Bug 661289 - Scratchpad Save File prompts to overwrite existing files twice.; r=rcampbell
browser/devtools/scratchpad/scratchpad.js
--- a/browser/devtools/scratchpad/scratchpad.js
+++ b/browser/devtools/scratchpad/scratchpad.js
@@ -535,17 +535,17 @@ var Scratchpad = {
   saveFileAs: function SP_saveFileAs()
   {
     let fp = Cc["@mozilla.org/filepicker;1"].createInstance(Ci.nsIFilePicker);
     fp.init(window, this.strings.GetStringFromName("saveFileAs"),
             Ci.nsIFilePicker.modeSave);
     fp.defaultString = "scratchpad.js";
     if (fp.show() != Ci.nsIFilePicker.returnCancel) {
       document.title = this.filename = fp.file.path;
-      this.exportToFile(fp.file);
+      this.exportToFile(fp.file, true);
     }
   },
 
   /**
    * Open the Error Console.
    */
   openErrorConsole: function SP_openErrorConsole()
   {