Skip to content
Browse files

fix for disabling "download project" on ftp projects

  • Loading branch information...
1 parent 87f92fc commit 78ce4106fba60a8bd23b8da418345d5ba80589a7 @linh81 linh81 committed
Showing with 28 additions and 24 deletions.
  1. +28 −24 client/ext/uploadfiles/uploadfiles.js
View
52 client/ext/uploadfiles/uploadfiles.js
@@ -44,9 +44,6 @@ module.exports = ext.register("ext/uploadfiles/uploadfiles", {
hook : function(){
var _self = this;
- ide.addEventListener("init.ext/ftp/ftp", function(){
- _self.projectType = "ftp";
- });
ide.addEventListener("init.ext/tree/tree", function(){
_self.nodes.push(
@@ -84,27 +81,34 @@ module.exports = ext.register("ext/uploadfiles/uploadfiles", {
);
ide.addEventListener("init.c9/ext/auth/auth", function(){
- if (_self.projectType != "ftp") {
- _self.nodes.push(
- ide.mnuFile.appendChild(new apf.item({
- caption : "Download Project",
- onclick : function(){
- window.open("/api/project/download/zip/" + ide.projectName);
- }
- })),
- winFilesViewer.insertBefore(new apf.button({
- top: "-22",
- skin: "header-btn",
- right: "56",
- icon: "download-ico.png",
- tooltip: "Download Files",
- onclick : function(){
- window.open("/api/project/download/zip/" + require("core/ide").projectName);
- }
- }), btnTreeRefresh)
- );
- btnUploadFiles.setProperty("right", "81");
- }
+ _self.nodes.push(
+ ide.mnuFile.appendChild(new apf.item({
+ id: "mnuDownloadProject",
+ caption : "Download Project",
+ onclick : function(){
+ window.open("/api/project/download/zip/" + ide.projectName);
+ }
+ })),
+ winFilesViewer.insertBefore(new apf.button({
+ id: "btnDownloadFiles",
+ top: "-22",
+ skin: "header-btn",
+ right: "56",
+ icon: "download-ico.png",
+ tooltip: "Download Files",
+ onclick : function(){
+ window.open("/api/project/download/zip/" + require("core/ide").projectName);
+ }
+ }), btnTreeRefresh)
+ );
+ btnUploadFiles.setProperty("right", "81");
+ });
+
+ ide.addEventListener("init.ext/ftp/ftp", function(){
+ _self.projectType = "ftp";
+ mnuDownloadProject.removeNode();
+ btnDownloadFiles.removeNode();
+ btnUploadFiles.setProperty("right", "56");
});
});
},

0 comments on commit 78ce410

Please sign in to comment.
Something went wrong with that request. Please try again.