thats paths

This commit is contained in:
Jon Lambson 2017-10-26 16:27:26 -06:00
parent 7bc9397564
commit 2579370bae
1 changed files with 21 additions and 4 deletions

View File

@ -441,6 +441,7 @@ app.controller('websiteCtrl', [
}; };
vm.getDirectoriesFromBreadcrumbs = function (dir) { vm.getDirectoriesFromBreadcrumbs = function (dir) {
vm.isRoot = false;
if (vm.copyR.shareAccess.path !== '/') { if (vm.copyR.shareAccess.path !== '/') {
var strictArray = vm.copyR.shareAccess.path.split('/'); var strictArray = vm.copyR.shareAccess.path.split('/');
if (vm.breadcrumbsPath.join('/') === '') { if (vm.breadcrumbsPath.join('/') === '') {
@ -463,11 +464,20 @@ app.controller('websiteCtrl', [
vm.breadcrumbsPath = breadcrumblies.split('/'); vm.breadcrumbsPath = breadcrumblies.split('/');
vm.breadcrumbs.push(dir); vm.breadcrumbs.push(dir);
} else { } else {
if (vm.copyR.shareAccess.path !== '/') { if (vm.copyR.shareAccess.path !== '/' && vm.copyR.newFile) {
vm.breadcrumbsPath.push(dir); if (vm.count === 1) {
vm.breadcrumbs.push(dir); vm.breadcrumbsPath.push(dir);
vm.breadcrumbs.push(dir);
} else {
if (vm.isRoot) {
vm.breadcrumbsPath.pop();
}
vm.breadcrumbsPath.push(dir);
vm.breadcrumbs.push(dir);
}
} else { } else {
vm.breadcrumbsPath.push(dir); vm.breadcrumbsPath.push(dir);
vm.breadcrumbs.push(dir);
} }
} }
vm.Sites.contents(vm.copyR, vm.breadcrumbsPath.join('/')); vm.Sites.contents(vm.copyR, vm.breadcrumbsPath.join('/'));
@ -478,6 +488,7 @@ app.controller('websiteCtrl', [
vm.Sites.contents(vm.copyR, vm.breadcrumbsPath.join('/')); vm.Sites.contents(vm.copyR, vm.breadcrumbsPath.join('/'));
} }
vm.currentFolder = vm.breadcrumbs[vm.breadcrumbs.length - 1]; vm.currentFolder = vm.breadcrumbs[vm.breadcrumbs.length - 1];
console.log(vm.breadcrumbsPath.join('/'));
}; };
vm.removeAllFiles = function (r, opts) { vm.removeAllFiles = function (r, opts) {
@ -512,7 +523,6 @@ app.controller('websiteCtrl', [
requestedPath = vm.breadcrumbsPath.join('/') + '/' + file; requestedPath = vm.breadcrumbsPath.join('/') + '/' + file;
} }
} }
requestedPath = cleanPathQuery(requestedPath);
opts = { opts = {
path: requestedPath path: requestedPath
}; };
@ -553,6 +563,8 @@ app.controller('websiteCtrl', [
var removeFolder = vm.previousSearchQuery.split('/'); var removeFolder = vm.previousSearchQuery.split('/');
removeFolder.pop(); removeFolder.pop();
vm.previousSearchQuery = removeFolder.join('/'); vm.previousSearchQuery = removeFolder.join('/');
vm.breadcrumbs.pop();
vm.breadcrumbsPath.pop();
vm.Sites.contents(vm.copyR, vm.previousSearchQuery); vm.Sites.contents(vm.copyR, vm.previousSearchQuery);
} else { } else {
vm.Sites.contents(vm.copyR, vm.previousSearchQuery); vm.Sites.contents(vm.copyR, vm.previousSearchQuery);
@ -616,6 +628,8 @@ app.controller('websiteCtrl', [
} }
}; };
vm.count = 0;
vm.isRoot = true;
vm.Sites.upload = function (r) { vm.Sites.upload = function (r) {
var pkg = Auth.oauth3.pkg('www@daplie.com'); var pkg = Auth.oauth3.pkg('www@daplie.com');
//analyzeFile(r.newFile, r); //analyzeFile(r.newFile, r);
@ -641,6 +655,9 @@ app.controller('websiteCtrl', [
r.uploadPath = cleanPathQuery(r.uploadPath); r.uploadPath = cleanPathQuery(r.uploadPath);
} }
} }
if (vm.copyR.newFile) {
vm.copyR.fAmount = vm.count++;
}
vm._uploadFile(pkg, r); vm._uploadFile(pkg, r);
}; };