mirror of
https://github.com/chinchang/web-maker.git
synced 2025-07-28 17:20:13 +02:00
Misc fixes for file explorer.
- Add validation while dropping a file - Refactor removing file to work on path not reference - style fixes
This commit is contained in:
@@ -103,27 +103,27 @@ function File({
|
||||
}, 1);
|
||||
}
|
||||
function dragStartHandler(e) {
|
||||
console.log(file.path);
|
||||
e.dataTransfer.setData('text/plain', file.path);
|
||||
}
|
||||
function dragOverHandler(e) {
|
||||
if (file.isFolder) {
|
||||
e.preventDefault();
|
||||
e.target.classList.add('is-being-dragged-over');
|
||||
e.target.style.outline = '1px dashed';
|
||||
console.log(e.target);
|
||||
e.currentTarget.classList.add('is-being-dragged-over');
|
||||
e.currentTarget.style.outline = '1px dashed';
|
||||
}
|
||||
}
|
||||
function dragLeaveHandler(e) {
|
||||
if (file.isFolder) {
|
||||
e.preventDefault();
|
||||
e.target.style.outline = null;
|
||||
e.currentTarget.style.outline = null;
|
||||
}
|
||||
}
|
||||
function dropHandler(e) {
|
||||
if (file.isFolder) {
|
||||
e.preventDefault();
|
||||
onFileDrop(e.dataTransfer.getData('text/plain'), file);
|
||||
e.target.style.outline = null;
|
||||
e.currentTarget.style.outline = null;
|
||||
}
|
||||
}
|
||||
return (
|
||||
|
Reference in New Issue
Block a user