diff --git a/js/controllers/website-controller.js b/js/controllers/website-controller.js index 47d8cf9..03954a4 100644 --- a/js/controllers/website-controller.js +++ b/js/controllers/website-controller.js @@ -229,6 +229,7 @@ app.controller('websiteCtrl', [ var msg = vm.newFileUploaded + " has been uploaded" opts.progress.uploadTotal = 0; vm.buildNotification(result, msg); + vm.cleanPath(); // window.alert(JSON.stringify(result)); }); }; @@ -338,16 +339,15 @@ app.controller('websiteCtrl', [ }; vm.Sites.setUpload = function (r) { console.log("Hey! At least it can tell if there's a change!"); - if (r.newFile === undefined) { r.newFile = vm.newFile; } analyzeFile(r.newFile, r); vm.showCompleteFileUploadBtn = true; console.log(r); - }; vm.Sites.upload = function (r) { + r.uploadPath = undefined; if (r.uploadPath === undefined) { r.uploadPath = vm.autoPopulateWebPath; } @@ -394,9 +394,7 @@ app.controller('websiteCtrl', [ vm.deleteFilesFrom = function (r, path, opts) { var confirmMessage; - // vm.autoPopulateWebPath; opts = {}; - if (path === undefined) { confirmMessage = "Delete all files for this site?"; opts.path = '/'; @@ -423,6 +421,7 @@ app.controller('websiteCtrl', [ if (!window.confirm(confirmMessage)) { return; } + vm.Sites.remove(r, opts); }; @@ -496,6 +495,10 @@ app.controller('websiteCtrl', [ vm.cleanPath = function () { vm.savedPath = vm.autoPopulateWebPath; vm.autoPopulateWebPath = ''; + vm.hideFolderInput = ''; + vm.showUploadFilesContainer = false; + vm.showCompleteFileUploadBtn = false; + vm.showUploadFolderContainer = false; }; vm.showUploadButton = true; @@ -504,7 +507,6 @@ app.controller('websiteCtrl', [ if (vm.savedPath === undefined) { vm.savedPath = '/'; } - // vm.savedPath; vm.hideFolderInput = 'hidden'; vm.showFileUploadBtn = true; r.uploadPath = vm.savedPath + vm.autoPopulateWebPath; @@ -728,7 +730,7 @@ app.controller('websiteCtrl', [ vm.websiteTiles = true; vm.showBackBtn = true; vm.displayFileTree = true; - if (vm.currentFolder === undefined) { + if (vm.currentFolder === undefined || vm.currentFolder === 'hidden' || vm.currentFolder === 'root') { vm.currentFolder = 'All Folders/Files'; } break; diff --git a/templates/website.html b/templates/website.html index e418804..0a4eefa 100644 --- a/templates/website.html +++ b/templates/website.html @@ -119,6 +119,7 @@