redesign parts of the file manager
ignore yarn.lock file
This commit is contained in:
parent
0c1559c922
commit
c62312b8af
10 changed files with 179 additions and 158 deletions
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -29,15 +29,22 @@ class ActionsClass {
|
|||
this.element = undefined;
|
||||
}
|
||||
|
||||
folder() {
|
||||
const nameBlock = $(this.element).find('td[data-identifier="name"]');
|
||||
const currentName = decodeURIComponent(nameBlock.attr('data-name'));
|
||||
const currentPath = decodeURIComponent(nameBlock.data('path'));
|
||||
folder(path) {
|
||||
let inputValue
|
||||
if (path) {
|
||||
inputValue = path
|
||||
} else {
|
||||
const nameBlock = $(this.element).find('td[data-identifier="name"]');
|
||||
const currentName = decodeURIComponent(nameBlock.data('name'));
|
||||
const currentPath = decodeURIComponent(nameBlock.data('path'));
|
||||
|
||||
let inputValue = `${currentPath}${currentName}/`;
|
||||
if ($(this.element).data('type') === 'file') {
|
||||
inputValue = currentPath;
|
||||
if ($(this.element).data('type') === 'file') {
|
||||
inputValue = currentPath;
|
||||
} else {
|
||||
inputValue = `${currentPath}${currentName}/`;
|
||||
}
|
||||
}
|
||||
|
||||
swal({
|
||||
type: 'input',
|
||||
title: 'Create Folder',
|
||||
|
|
|
@ -33,7 +33,7 @@ class ContextMenuClass {
|
|||
$(document).find('#fileOptionMenu').remove();
|
||||
if (!_.isNull(this.activeLine)) this.activeLine.removeClass('active');
|
||||
|
||||
let newFilePath = $('#headerTableRow').attr('data-currentDir');
|
||||
let newFilePath = $('#file_listing').data('current-dir');
|
||||
if (parent.data('type') === 'folder') {
|
||||
const nameBlock = parent.find('td[data-identifier="name"]');
|
||||
const currentName = decodeURIComponent(nameBlock.attr('data-name'));
|
||||
|
|
|
@ -44,6 +44,7 @@ class FileManager {
|
|||
$('#load_files').slideUp(10).html(data).slideDown(10, () => {
|
||||
ContextMenu.run();
|
||||
this.reloadFilesButton();
|
||||
this.addFolderButton();
|
||||
if (_.isFunction(next)) {
|
||||
return next();
|
||||
}
|
||||
|
@ -82,6 +83,12 @@ class FileManager {
|
|||
});
|
||||
}
|
||||
|
||||
addFolderButton() {
|
||||
$('i[data-action="add-folder"]').unbind().on('click', () => {
|
||||
new ActionsClass().folder($('#file_listing').data('current-dir') || '/');
|
||||
})
|
||||
}
|
||||
|
||||
decodeHash() {
|
||||
return decodeURIComponent(window.location.hash.substring(1));
|
||||
}
|
||||
|
|
|
@ -84,7 +84,7 @@
|
|||
window.onbeforeunload = function () {
|
||||
return 'A file upload in in progress, are you sure you want to continue?';
|
||||
};
|
||||
event.file.meta.path = $('#headerTableRow').attr('data-currentdir');
|
||||
event.file.meta.path = $('#file_listing').data('current-dir');
|
||||
event.file.meta.identifier = Math.random().toString(36).slice(2);
|
||||
|
||||
$('#append_files_to').append('<tr id="file-upload-' + event.file.meta.identifier +'"> \
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue