diff --git a/js/controllers/website-controller.js b/js/controllers/website-controller.js index 23958e2..7ca5df6 100644 --- a/js/controllers/website-controller.js +++ b/js/controllers/website-controller.js @@ -307,6 +307,7 @@ app.controller('websiteCtrl', [ console.log(r); }; vm.Sites.upload = function (r) { + r.uploadPath = vm.autoPopulateWebPath; var pkg = Auth.oauth3.pkg('www@daplie.com'); //analyzeFile(r.newFile, r); vm._uploadFile(pkg, r); @@ -348,10 +349,10 @@ app.controller('websiteCtrl', [ vm.breadcrumbs = ['Root']; vm.breadcrumbsPath = ['/']; vm.breadcrumbPathClicked = false; + vm.webPathAutofill = '/'; vm.Sites.contents = function (r) { vm.siteResults = r; vm.directoryPath = r.newPath; - vm.showListFiles = true; vm.siteDirectories = []; vm.siteFiles = []; var pkg = Auth.oauth3.pkg('www@daplie.com'); @@ -362,12 +363,17 @@ app.controller('websiteCtrl', [ if (typeof path !== 'object') { vm.breadcrumbs.push(path); vm.breadcrumbsPath.push(path); + vm.autoPopulateWebPath = vm.breadcrumbsPath; + vm.autoPopulateWebPath.push('/'); + vm.autoPopulateWebPath = vm.autoPopulateWebPath.join(''); } if (vm.breadcrumbPathClicked) { if (path === 'Root') { vm.breadcrumbs = ['Root']; vm.breadcrumbsPath = ['/']; vm.breadcrumbPathClicked = false; + vm.autoPopulateWebPath = "/"; + vm.showUploadContainer = false; } else { var breadcrumbsPath = vm.breadcrumbsPath; var breadcrumbs = vm.breadcrumbs; @@ -375,6 +381,9 @@ app.controller('websiteCtrl', [ var removeFromBreadcrumbs = breadcrumbs.indexOf(path) + 1; vm.breadcrumbsPath = breadcrumbsPath.splice(0,removeFromBreadcrumbsPath); vm.breadcrumbs = breadcrumbs.splice(0,removeFromBreadcrumbs); + var updatebreadcrumbsPath = vm.breadcrumbsPath; + vm.autoPopulateWebPath = updatebreadcrumbsPath.join(''); + vm.autoPopulateWebPath = vm.autoPopulateWebPath+"/"; } } } @@ -569,11 +578,6 @@ app.controller('websiteCtrl', [ vm.websiteTiles = true; vm.showBackBtn = true; break; - case 'upload': - vm.showUploadContainer = true; - vm.websiteTiles = true; - vm.showBackBtn = true; - break; default: } }; diff --git a/templates/website.html b/templates/website.html index db093a0..4bd9000 100644 --- a/templates/website.html +++ b/templates/website.html @@ -12,7 +12,7 @@