Appearance
UploadBackdrop Component ​
File Information ​
- Path:
app/components/asset/UploadBackdrop.vue - Purpose: Full-screen drag-and-drop overlay that intercepts files/folders dragged anywhere onto a DAM page and hands them off to the upload flow.
Overview ​
UploadBackdrop is mounted once inside the collage-layout wrapper so it covers the entire DAM shell. It listens for native dragenter, dragover, dragleave, and drop events on document, uses a counter to track nested elements (preventing flicker when crossing child boundaries), and shows the drop zone only when isDropping is true.
When files are dropped:
- The component calls
DropHandlerfromutils/file-hierarchyto traverse the DataTransfer'sFileSystemEntrytree, resolving both flat files and nested folder structures. - It checks permissions (
canUploadContent,canCreateFolders), storage limits (5 GB), and folder-creation access. - If the current route is a folder detail page it creates any missing subfolders, then queues the files via
useUploadCommon. - Files dropped outside a folder context go to the root.
Version upload mode (isVersionUpload: true) restricts the drop zone to a single file and omits the folder-upload hint.
Props ​
| Prop | Type | Default | Description |
|---|---|---|---|
isDropping | Boolean | false | Controls overlay visibility; bind with v-model:isDropping |
isVersionUpload | Boolean | false | Restricts to a single file; hides folder drop text |
Events ​
| Event | Payload | When |
|---|---|---|
update:isDropping | boolean | Drag enters or leaves the window |
upload | DragEvent | Files have been resolved and upload is about to begin |
Drag Counter ​
The component tracks drag entry/exit with dragCounter (increments on dragenter, decrements on dragleave). This is the standard fix for the browser bug where crossing a child element fires dragleave on the parent before the next dragenter, which would otherwise flicker the overlay.
Usage ​
vue
<!-- Inside collage-layout.vue -->
<UploadBackdrop v-model:isDropping="isDragging" />Related Documentation ​
- Asset Upload Component — dialog-based upload form for manually selected files
- upload-common Mixin — shared upload initialization used internally
- File Upload Feature — full upload flow overview