diff --git a/js/controllers/website-controller.js b/js/controllers/website-controller.js index e5b4567..c79b875 100644 --- a/js/controllers/website-controller.js +++ b/js/controllers/website-controller.js @@ -207,6 +207,7 @@ app.controller('websiteCtrl', [ }); }; vm._uploadFile = function (pkg, opts) { + debugger; vm.newFileUploaded = opts.newFile.name; opts.progress = opts.progress || opts; return pkg.add({ @@ -230,7 +231,6 @@ 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)); }); }; @@ -518,6 +518,29 @@ app.controller('websiteCtrl', [ vm.Shares.invite(r, opts); }; + vm.createNewFolder = function (r) { + if (vm.breadcrumbsPath.join('/') === '') { + r.folderName = '/' + vm.folderName + '/'; + } else { + r.folderName = vm.breadcrumbsPath.join('/') + '/' + vm.folderName + '/'; + } + }; + + vm.Sites.upload = function (r) { + var pkg = Auth.oauth3.pkg('www@daplie.com'); + //analyzeFile(r.newFile, r); + if (r.folderName !== '' && r.folderName !== undefined) { + r.uploadPath = r.folderName; + } else { + if (vm.breadcrumbsPath.join('/') === '') { + r.uploadPath = '/'; + } else { + r.uploadPath = vm.breadcrumbsPath.join('/') + '/'; + } + } + vm._uploadFile(pkg, r); + }; + vm.Shares = {}; vm.Shares.invite = function (r, opts) { var pkg = Auth.oauth3.pkg('www@daplie.com'); diff --git a/templates/widgets/filetree.html b/templates/widgets/filetree.html index 2f00732..fa82fd8 100644 --- a/templates/widgets/filetree.html +++ b/templates/widgets/filetree.html @@ -25,7 +25,7 @@