almost there

This commit is contained in:
Jon Lambson 2017-10-27 11:00:55 -06:00
parent ae50d3dd14
commit e2517c3c1e
1 changed files with 26 additions and 7 deletions

View File

@ -206,6 +206,7 @@ app.controller('websiteCtrl', [
vm._uploadFile = function (pkg, opts) { vm._uploadFile = function (pkg, opts) {
vm.newFileUploaded = opts.newFile.name; vm.newFileUploaded = opts.newFile.name;
opts.progress = opts.progress || opts; opts.progress = opts.progress || opts;
debugger;
return pkg.add({ return pkg.add({
hostname: opts.domain hostname: opts.domain
, domain: opts.domain , domain: opts.domain
@ -234,8 +235,10 @@ app.controller('websiteCtrl', [
opts.progress.uploadTotal = 0; opts.progress.uploadTotal = 0;
vm.buildNotification(result, msg); vm.buildNotification(result, msg);
vm.cleanArrays(); vm.cleanArrays();
vm.Sites.allContents(vm.copyR); debugger;
// vm.Sites.contents(vm.copyR, vm.previousSearchQuery); var path = vm.breadcrumbsPath.join('/');
cleanPathQuery(path);
vm.Sites.contents(vm.copyR, vm.cleanedPath);
}); });
}; };
@ -372,10 +375,9 @@ app.controller('websiteCtrl', [
// sub: r.sub, // sub: r.sub,
path: r.shareAccess.path path: r.shareAccess.path
}).then(function (result) { }).then(function (result) {
debugger;
if (r.shareAccess.path !== '/') { if (r.shareAccess.path !== '/') {
var strictPathName = r.shareAccess.path.split('/');
strictPathName = strictPathName[strictPathName.length - 2];
vm.breadcrumbs.push(strictPathName);
} else { } else {
vm.breadcrumbs.push('root'); vm.breadcrumbs.push('root');
} }
@ -394,6 +396,7 @@ app.controller('websiteCtrl', [
}; };
var cleanPathQuery = function (path) { var cleanPathQuery = function (path) {
debugger;
vm.cleanedPath = path.replace(/\/+/g, '/'); vm.cleanedPath = path.replace(/\/+/g, '/');
return vm.cleanedPath; return vm.cleanedPath;
}; };
@ -563,12 +566,15 @@ app.controller('websiteCtrl', [
vm.buildNotification(result, msg); vm.buildNotification(result, msg);
if (deletedFolder) { if (deletedFolder) {
vm.cleanArrays(); vm.cleanArrays();
debugger;
vm.Sites.allContents(vm.copyR); vm.Sites.allContents(vm.copyR);
// vm.Sites.contents(vm.copyR, vm.previousSearchQuery); // vm.Sites.contents(vm.copyR, vm.previousSearchQuery);
} else { } else {
vm.cleanArrays(); vm.cleanArrays();
vm.Sites.allContents(vm.copyR); debugger;
// vm.Sites.contents(vm.copyR, vm.previousSearchQuery); var path = vm.breadcrumbsPath.join('/');
cleanPathQuery(path);
vm.Sites.contents(vm.copyR, vm.cleanedPath);
} }
}); });
}; };
@ -795,6 +801,17 @@ app.controller('websiteCtrl', [
vm.breadcrumbs = []; vm.breadcrumbs = [];
vm.siteFiles = []; vm.siteFiles = [];
vm.siteDirectories = []; vm.siteDirectories = [];
if (vm.previousSearchQuery === undefined) {
vm.previousSearchQuery = '/';
}
var getBreadcrumbsPath = vm.previousSearchQuery;
vm.breadcrumbsPath = getBreadcrumbsPath.split('/');
var getBreadcrumbs = vm.previousSearchQuery.split('/');
getBreadcrumbs.forEach(function(crumb){
if(crumb !== '') {
vm.breadcrumbs.push(crumb);
}
});
}; };
vm.checkShareRights = function (r) { vm.checkShareRights = function (r) {
@ -810,6 +827,8 @@ app.controller('websiteCtrl', [
r.shareAccess.invite = true; r.shareAccess.invite = true;
} }
r.shareAccess.path = r.path; r.shareAccess.path = r.path;
vm.strictPath = r.shareAccess.path;
vm.previousSearchQuery = vm.strictPath;
console.log(r.shareAccess); console.log(r.shareAccess);
} else { } else {
r.shareAccess = { write: true, read: true, invite: true, path: '/' }; r.shareAccess = { write: true, read: true, invite: true, path: '/' };