folders deleted search query

This commit is contained in:
Jon Lambson 2017-10-26 11:26:43 -06:00
parent 894ccf09df
commit 7bc9397564
1 changed files with 14 additions and 1 deletions

View File

@ -528,10 +528,16 @@ app.controller('websiteCtrl', [
}; };
vm.Sites.remove = function (r, opts) { vm.Sites.remove = function (r, opts) {
var deletedFolder;
if (!window.confirm("Delete files for this site?")) { if (!window.confirm("Delete files for this site?")) {
return; return;
} }
var pkg = Auth.oauth3.pkg('www@daplie.com'); var pkg = Auth.oauth3.pkg('www@daplie.com');
if (opts.path.includes('.')) {
deletedFolder = false;
} else {
deletedFolder = true;
}
return pkg.remove({ return pkg.remove({
hostname: r.domain, hostname: r.domain,
domain: r.domain, domain: r.domain,
@ -543,7 +549,14 @@ app.controller('websiteCtrl', [
}).then(function (result) { }).then(function (result) {
var msg = "'"+ vm.pathRemoved + "'" + ' has been removed.'; var msg = "'"+ vm.pathRemoved + "'" + ' has been removed.';
vm.buildNotification(result, msg); 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);
}
}); });
}; };