Bug 937607 - Only save manifest when editor is shown. r=paul, a=bajaj
authorJ. Ryan Stinnett <jryans@gmail.com>
Sun, 24 Nov 2013 20:33:44 -0600
changeset 167575 2a3e0cf45dbfec2895f6094e2981441cedc56e97
parent 167574 e7be5919512b829fad0cb81d8768c97ed885240a
child 167576 02294155afa93afd999f259abfd72c700cb0fe7b
push id428
push userbbajaj@mozilla.com
push dateTue, 28 Jan 2014 00:16:25 +0000
treeherdermozilla-release@cd72a7ff3a75 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerspaul, bajaj
bugs937607
milestone27.0a2
Bug 937607 - Only save manifest when editor is shown. r=paul, a=bajaj
browser/devtools/app-manager/content/projects.js
--- a/browser/devtools/app-manager/content/projects.js
+++ b/browser/devtools/app-manager/content/projects.js
@@ -172,17 +172,17 @@ let UI = {
 
       });
 
   },
 
   update: function(button, location) {
     button.disabled = true;
     let project = AppProjects.get(location);
-    this.manifestEditor.save()
+    this.saveManifest()
         .then(() => {
           return this.validate(project);
         })
         .then(() => {
            // Install the app to the device if we are connected,
            // and there is no error
            if (project.errorsCount == 0 && this.listTabsResponse) {
              return this.install(project);
@@ -195,16 +195,23 @@ let UI = {
          (res) => {
            button.disabled = false;
            let message = res.error + ": " + res.message;
            alert(message);
            this.connection.log(message);
          });
   },
 
+  saveManifest: function() {
+    if (Services.prefs.getBoolPref(MANIFEST_EDITOR_ENABLED)) {
+      return this.manifestEditor.save();
+    }
+    return promise.resolve();
+  },
+
   remove: function(location, event) {
     if (event) {
       // We don't want the "click" event to be propagated to the project item.
       // That would trigger `selectProject()`.
       event.stopPropagation();
     }
 
     let item = document.getElementById(location);