Fixed FileDropArea in Drive (#5993)

Signed-off-by: Alexander Platov <alexander.platov@hardcoreeng.com>
This commit is contained in:
Alexander Platov 2024-07-03 17:23:10 +03:00 committed by GitHub
parent 15d9661f29
commit 6756c43e4e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 16 additions and 21 deletions

View File

@ -71,34 +71,29 @@
<!-- svelte-ignore a11y-no-static-element-interactions --> <!-- svelte-ignore a11y-no-static-element-interactions -->
<div <div
class="dropzone h-full" class="dropzone flex-col w-full h-full"
class:dragover
on:dragenter={handleDragEnter} on:dragenter={handleDragEnter}
on:dragleave={handleDragLeave} on:dragleave={handleDragLeave}
on:dragover|preventDefault={handleDragOver} on:dragover|preventDefault={handleDragOver}
on:drop={handleDrop} on:drop={handleDrop}
> >
{#if dragover}
<div class="dropzone-overlay" />
{/if}
<slot /> <slot />
</div> </div>
<style lang="scss"> <style lang="scss">
.dropzone { .dropzone {
position: relative; position: relative;
}
.dropzone-overlay { &::after {
pointer-events: none;
z-index: 1;
position: absolute; position: absolute;
top: 0; inset: 0;
right: 0;
bottom: 0;
left: 0;
background-color: var(--primary-button-transparent); background-color: var(--primary-button-transparent);
border: 2px dashed var(--primary-button-outline); border: 2px dashed var(--primary-button-outline);
pointer-events: none;
}
&.dragover::after {
content: '';
}
} }
</style> </style>

View File

@ -69,11 +69,11 @@
<FilterBar {_class} {space} query={searchQuery} {viewOptions} on:change={(e) => (resultQuery = e.detail)} /> <FilterBar {_class} {space} query={searchQuery} {viewOptions} on:change={(e) => (resultQuery = e.detail)} />
<div class="popupPanel rowContent" on:contextmenu> <div class="popupPanel rowContent" on:contextmenu>
{#if viewlet} {#if viewlet}
<Scroller horizontal={true}>
<FileDropArea {space} {parent} canDrop={() => !readonly}> <FileDropArea {space} {parent} canDrop={() => !readonly}>
<Scroller horizontal={true}>
<ViewletContentView {_class} {viewlet} query={resultQuery} {space} {viewOptions} /> <ViewletContentView {_class} {viewlet} query={resultQuery} {space} {viewOptions} />
</FileDropArea>
</Scroller> </Scroller>
</FileDropArea>
{/if} {/if}
</div> </div>
{/if} {/if}