folders deleted search query
This commit is contained in:
parent
894ccf09df
commit
7bc9397564
|
@ -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);
|
||||||
|
if (deletedFolder) {
|
||||||
|
var removeFolder = vm.previousSearchQuery.split('/');
|
||||||
|
removeFolder.pop();
|
||||||
|
vm.previousSearchQuery = removeFolder.join('/');
|
||||||
vm.Sites.contents(vm.copyR, vm.previousSearchQuery);
|
vm.Sites.contents(vm.copyR, vm.previousSearchQuery);
|
||||||
|
} else {
|
||||||
|
vm.Sites.contents(vm.copyR, vm.previousSearchQuery);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue