fixing some upload weirdness
This commit is contained in:
parent
fb64b8bedc
commit
aa72c44bdb
|
@ -229,6 +229,7 @@ app.controller('websiteCtrl', [
|
|||
var msg = vm.newFileUploaded + " has been uploaded"
|
||||
opts.progress.uploadTotal = 0;
|
||||
vm.buildNotification(result, msg);
|
||||
vm.cleanPath();
|
||||
// window.alert(JSON.stringify(result));
|
||||
});
|
||||
};
|
||||
|
@ -338,16 +339,15 @@ app.controller('websiteCtrl', [
|
|||
};
|
||||
vm.Sites.setUpload = function (r) {
|
||||
console.log("Hey! At least it can tell if there's a change!");
|
||||
|
||||
if (r.newFile === undefined) {
|
||||
r.newFile = vm.newFile;
|
||||
}
|
||||
analyzeFile(r.newFile, r);
|
||||
vm.showCompleteFileUploadBtn = true;
|
||||
console.log(r);
|
||||
|
||||
};
|
||||
vm.Sites.upload = function (r) {
|
||||
r.uploadPath = undefined;
|
||||
if (r.uploadPath === undefined) {
|
||||
r.uploadPath = vm.autoPopulateWebPath;
|
||||
}
|
||||
|
@ -394,9 +394,7 @@ app.controller('websiteCtrl', [
|
|||
|
||||
vm.deleteFilesFrom = function (r, path, opts) {
|
||||
var confirmMessage;
|
||||
// vm.autoPopulateWebPath;
|
||||
opts = {};
|
||||
|
||||
if (path === undefined) {
|
||||
confirmMessage = "Delete all files for this site?";
|
||||
opts.path = '/';
|
||||
|
@ -423,6 +421,7 @@ app.controller('websiteCtrl', [
|
|||
if (!window.confirm(confirmMessage)) {
|
||||
return;
|
||||
}
|
||||
|
||||
vm.Sites.remove(r, opts);
|
||||
};
|
||||
|
||||
|
@ -496,6 +495,10 @@ app.controller('websiteCtrl', [
|
|||
vm.cleanPath = function () {
|
||||
vm.savedPath = vm.autoPopulateWebPath;
|
||||
vm.autoPopulateWebPath = '';
|
||||
vm.hideFolderInput = '';
|
||||
vm.showUploadFilesContainer = false;
|
||||
vm.showCompleteFileUploadBtn = false;
|
||||
vm.showUploadFolderContainer = false;
|
||||
};
|
||||
|
||||
vm.showUploadButton = true;
|
||||
|
@ -504,7 +507,6 @@ app.controller('websiteCtrl', [
|
|||
if (vm.savedPath === undefined) {
|
||||
vm.savedPath = '/';
|
||||
}
|
||||
// vm.savedPath;
|
||||
vm.hideFolderInput = 'hidden';
|
||||
vm.showFileUploadBtn = true;
|
||||
r.uploadPath = vm.savedPath + vm.autoPopulateWebPath;
|
||||
|
|
|
@ -119,6 +119,7 @@
|
|||
</div>
|
||||
<div class="card__content">
|
||||
<div class="card__title text-center"><a ng-href="https://{{ r.domain }}" target="_blank" ng-bind="r.domain">example.com</a></div>
|
||||
<div class="cards__title text-center"><span ng-if="r.pending" class="text-muted">(pending)</span></div>
|
||||
<button class="btn btn--block card__btn" data-toggle="modal" data-target=".{{ r.challenge }}" ng-click="vm.closeAllOpenActions()">Edit</button>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -182,7 +183,7 @@
|
|||
</div>
|
||||
<div class="col-md-3">
|
||||
<div class="square-service-block">
|
||||
<a ng-click="vm.Sites.remove(r)" class="cp">
|
||||
<a ng-click="vm.deleteFilesFrom(r)" class="cp">
|
||||
<div class="ssb-icon"><i class="fa fa-trash" aria-hidden="true"></i></div>
|
||||
<h2 class="ssb-title">Delete</h2>
|
||||
</a>
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<div class="text-left" ng-hide="vm.displayFileTree">
|
||||
<div class="row">
|
||||
<ul class="breadcrumb">
|
||||
<li ng-repeat="breadcrumb in vm.breadcrumbs track by $index" ng-click="vm.getDirectoriesFromBreadcrumbs(breadcrumb); vm.showUploadContainer = false; vm.showUploadFolderContainer = false; vm.showUploadFilesContainer = false;" data="{{ breadcrumb }}" class="cp breadcrumbs-list">
|
||||
<li ng-repeat="breadcrumb in vm.breadcrumbs track by $index" ng-click="vm.getDirectoriesFromBreadcrumbs(breadcrumb); vm.cleanPath();" data="{{ breadcrumb }}" class="cp breadcrumbs-list">
|
||||
{{ breadcrumb | capitalize }}
|
||||
</li>
|
||||
</ul>
|
||||
|
@ -14,7 +14,7 @@
|
|||
<ul class="tree ls-none">
|
||||
<li class="directories-go-here" ng-repeat="directory in vm.siteDirectories track by $index">
|
||||
<input type="checkbox" id="{{ r.challenge }}{{ $index }}" />
|
||||
<label class="tree_label" for="{{ r.challenge }}{{ $index }}" ng-click="vm.getDirectories(directory); vm.showUploadContainer = false; vm.showUploadFolderContainer = false; vm.showUploadFilesContainer = false;" data="{{ directory }}">{{ directory }}</label><span class="pull-right"><button type="button" class="btn btn-danger btn-xs" ng-click="vm.deleteFilesFrom(r, directory)" data="{{ directory }}" ><i class="fa fa-trash"></i></button></span>
|
||||
<label class="tree_label" for="{{ r.challenge }}{{ $index }}" ng-click="vm.getDirectories(directory); vm.cleanPath();" data="{{ directory }}">{{ directory }}</label><span class="pull-right"><button type="button" class="btn btn-danger btn-xs" ng-click="vm.deleteFilesFrom(r, directory)" data="{{ directory }}" ><i class="fa fa-trash"></i></button></span>
|
||||
</li>
|
||||
</ul>
|
||||
<ul class="tree files-only ls-none">
|
||||
|
@ -29,7 +29,7 @@
|
|||
<button type="button" name="button" class="btn btn-block btn-primary" ng-click="vm.showAction('invite');">Share folder</button>
|
||||
<ul class="ls-none folder-actions-list">
|
||||
<li class="" ng-hide="vm.showFolderAction"><span><i class="fa fa-upload cp"></i> <a ng-click="vm.showUploadFilesContainer = true; vm.autoPopulateFolderName(); vm.showUploadFolderContainer = false;" class="cp">Upload files</a></span></li>
|
||||
<li class=""><span><i class="fa fa-folder cp"></i> <a ng-click="vm.showUploadFolderContainer = true; vm.cleanPath(); vm.showUploadFilesContainer = false;" class="cp">New folder</a></span></li>
|
||||
<li class=""><span><i class="fa fa-folder cp"></i> <a ng-click="vm.cleanPath(); vm.showUploadFolderContainer = true;" class="cp">New folder</a></span></li>
|
||||
<li ng-hide="vm.showUploadButton"><span><i class="fa fa-trash cp"></i> <a ng-click="vm.triggerDeleteFolder(vm.currentFolder, r)" data="{{ vm.currentFolder }}" class="cp">Delete {{ vm.currentFolder | capitalize }} Folder</a></span></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
|
Loading…
Reference in New Issue