Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions 07-tier-maker/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,7 @@
}

function useFilesToCreateItems(files) {
if (draggedElement) return
if (files && files.length > 0) {
Array.from(files).forEach(file => {
const reader = new FileReader()
Expand Down Expand Up @@ -217,7 +218,7 @@

if (dataTransfer.types.includes('Files')) {
currentTarget.classList.add('drag-files')
}
}
Comment thread
AlexDG84 marked this conversation as resolved.
Outdated
}

function handleDropFromDesktop(event) {
Expand All @@ -228,7 +229,7 @@
currentTarget.classList.remove('drag-files')
const { files } = dataTransfer
useFilesToCreateItems(files)
}
}
Comment thread
AlexDG84 marked this conversation as resolved.
Outdated
}

function handleDrop(event) {
Expand Down Expand Up @@ -272,6 +273,7 @@

const { currentTarget } = event
currentTarget.classList.remove('drag-over')
currentTarget.classList.remove('drag-files');
Comment thread
AlexDG84 marked this conversation as resolved.
Outdated
currentTarget.querySelector('.drag-preview')?.remove()
}

Expand Down