Complete code for new file manager

This commit is contained in:
Dane Everitt 2016-10-04 21:38:22 -04:00
parent 4d922b6a0c
commit 9c7b753576
No known key found for this signature in database
GPG key ID: EEA66103B3D71F53
4 changed files with 111 additions and 11 deletions

View file

@ -24,7 +24,7 @@ class FileManager {
this.list(this.decodeHash());
}
list(path, isError) {
list(path, next) {
if (_.isUndefined(path)) {
path = this.decodeHash();
}
@ -43,16 +43,21 @@ class FileManager {
this.loader(false);
$('#load_files').slideUp().html(data).slideDown(100, () => {
ContextMenu.run();
if (_.isFunction(next)) {
return next();
}
});
$('#internal_alert').slideUp();
}).fail(jqXHR => {
this.loader(false);
if (_.isFunction(next)) {
return next(new Error('Failed to load file listing.'));
}
swal({
type: 'error',
title: 'File Error',
text: 'An error occured while attempting to process this request. Please try again.',
});
if (!isError) this.list('/', true);
console.log(jqXHR);
})
}