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