From 7bc9397564707f7690904b3aaf0c490b9a8faf46 Mon Sep 17 00:00:00 2001 From: Jon Lambson Date: Thu, 26 Oct 2017 11:26:43 -0600 Subject: [PATCH] folders deleted search query --- js/controllers/website-controller.js | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/js/controllers/website-controller.js b/js/controllers/website-controller.js index 7e70611..6e8c1d7 100644 --- a/js/controllers/website-controller.js +++ b/js/controllers/website-controller.js @@ -528,10 +528,16 @@ app.controller('websiteCtrl', [ }; vm.Sites.remove = function (r, opts) { + var deletedFolder; if (!window.confirm("Delete files for this site?")) { return; } var pkg = Auth.oauth3.pkg('www@daplie.com'); + if (opts.path.includes('.')) { + deletedFolder = false; + } else { + deletedFolder = true; + } return pkg.remove({ hostname: r.domain, domain: r.domain, @@ -543,7 +549,14 @@ app.controller('websiteCtrl', [ }).then(function (result) { var msg = "'"+ vm.pathRemoved + "'" + ' has been removed.'; vm.buildNotification(result, msg); - vm.Sites.contents(vm.copyR, vm.previousSearchQuery); + if (deletedFolder) { + var removeFolder = vm.previousSearchQuery.split('/'); + removeFolder.pop(); + vm.previousSearchQuery = removeFolder.join('/'); + vm.Sites.contents(vm.copyR, vm.previousSearchQuery); + } else { + vm.Sites.contents(vm.copyR, vm.previousSearchQuery); + } }); };