diff --git a/CHANGELOG.md b/CHANGELOG.md index b536c553..5d3884bd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # Change Log +## [7.6.1](https://github.com/dldevinc/paper-admin/tree/v7.6.1) - 2023-12-12 + +### Bug Fixes + +- The issue has been fixed where the dropzone remained in a highlighted state after dropping a file. + ## [7.6.0](https://github.com/dldevinc/paper-admin/tree/v7.6.0) - 2023-12-07 ### Features diff --git a/package.json b/package.json index d4bf9b3c..6d05ea65 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "paper-admin", - "version": "7.6.0", + "version": "7.6.1", "description": "", "type": "module", "scripts": { diff --git a/paper_admin/__init__.py b/paper_admin/__init__.py index 7a067fd4..0a5a8b58 100644 --- a/paper_admin/__init__.py +++ b/paper_admin/__init__.py @@ -1,2 +1,2 @@ -__version__ = "7.6.0" +__version__ = "7.6.1" default_app_config = "paper_admin.apps.Config" diff --git a/paper_admin/static/paper_admin/src/bem/paper-dropzone/paper-dropzone.js b/paper_admin/static/paper_admin/src/bem/paper-dropzone/paper-dropzone.js index 6b55328a..55262b6f 100644 --- a/paper_admin/static/paper_admin/src/bem/paper-dropzone/paper-dropzone.js +++ b/paper_admin/static/paper_admin/src/bem/paper-dropzone/paper-dropzone.js @@ -1,12 +1,16 @@ import "./paper-dropzone.scss"; +const OVERLAY_CLASS = "paper-dropzone__overlay"; +const OVERLAY_HIGHLIGHTED = "paper-dropzone__overlay--highlighted"; + + document.addEventListener( "dragenter", event => { const dropzone = event.target.closest(".paper-dropzone"); if (dropzone) { - const overlay = dropzone.querySelector(".paper-dropzone__overlay"); - overlay && overlay.classList.add("paper-dropzone__overlay--highlighted"); + const overlay = dropzone.querySelector(`.${OVERLAY_CLASS}`); + overlay && overlay.classList.add(OVERLAY_HIGHLIGHTED); } }, true @@ -17,8 +21,20 @@ document.addEventListener( event => { const dropzone = event.target.closest(".paper-dropzone"); if (dropzone) { - const overlay = dropzone.querySelector(".paper-dropzone__overlay"); - overlay && overlay.classList.remove("paper-dropzone__overlay--highlighted"); + const overlay = dropzone.querySelector(`.${OVERLAY_CLASS}`); + overlay && overlay.classList.remove(OVERLAY_HIGHLIGHTED); + } + }, + true +); + +document.addEventListener( + "drop", + event => { + const dropzone = event.target.closest(".paper-dropzone"); + if (dropzone) { + const overlay = dropzone.querySelector(`.${OVERLAY_CLASS}`); + overlay && overlay.classList.remove(OVERLAY_HIGHLIGHTED); } }, true