From 2ef31605047d749d73f732fa4b70d677199a957c Mon Sep 17 00:00:00 2001 From: Alex Diaz Date: Mon, 12 Aug 2024 10:47:47 +0200 Subject: [PATCH 1/2] Tier-maker: duplicate items and correct CSS Fix when you drop --- 07-tier-maker/index.html | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/07-tier-maker/index.html b/07-tier-maker/index.html index a602b04..0c1b92b 100644 --- a/07-tier-maker/index.html +++ b/07-tier-maker/index.html @@ -174,6 +174,7 @@ } function useFilesToCreateItems(files) { + if (draggedElement) return if (files && files.length > 0) { Array.from(files).forEach(file => { const reader = new FileReader() @@ -217,7 +218,7 @@ if (dataTransfer.types.includes('Files')) { currentTarget.classList.add('drag-files') - } + } } function handleDropFromDesktop(event) { @@ -228,7 +229,7 @@ currentTarget.classList.remove('drag-files') const { files } = dataTransfer useFilesToCreateItems(files) - } + } } function handleDrop(event) { @@ -272,6 +273,7 @@ const { currentTarget } = event currentTarget.classList.remove('drag-over') + currentTarget.classList.remove('drag-files'); currentTarget.querySelector('.drag-preview')?.remove() } From 650411b1fdb6aa79e624ec16370f86353023df84 Mon Sep 17 00:00:00 2001 From: Alex <126770971+AlexDG84@users.noreply.github.com> Date: Mon, 12 Aug 2024 13:57:08 +0200 Subject: [PATCH 2/2] Apply suggestions from code review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Quito cambio de llaves que no aportan y el punto y coma final, a peticion de otra persona. Co-authored-by: Harley Santos Garzón --- 07-tier-maker/index.html | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/07-tier-maker/index.html b/07-tier-maker/index.html index 0c1b92b..58b051c 100644 --- a/07-tier-maker/index.html +++ b/07-tier-maker/index.html @@ -218,7 +218,7 @@ if (dataTransfer.types.includes('Files')) { currentTarget.classList.add('drag-files') - } + } } function handleDropFromDesktop(event) { @@ -229,7 +229,7 @@ currentTarget.classList.remove('drag-files') const { files } = dataTransfer useFilesToCreateItems(files) - } + } } function handleDrop(event) { @@ -273,7 +273,7 @@ const { currentTarget } = event currentTarget.classList.remove('drag-over') - currentTarget.classList.remove('drag-files'); + currentTarget.classList.remove('drag-files') currentTarget.querySelector('.drag-preview')?.remove() }