Disable dashbaord dnd if global dnd active

This commit is contained in:
shamoon 2023-09-24 08:38:44 -07:00
parent 737da43978
commit a4c5d0429f
4 changed files with 5 additions and 5 deletions

View File

@ -262,6 +262,7 @@ export class AppComponent implements OnInit, OnDestroy {
}
public fileOver() {
this.settings.globalDropzoneActive = true
// allows transition
setTimeout(() => {
this.fileIsOver = true
@ -272,6 +273,7 @@ export class AppComponent implements OnInit, OnDestroy {
}
public fileLeave(immediate: boolean = false) {
this.settings.globalDropzoneActive = false
const ms = immediate ? 0 : 500
this.fileLeaveTimeoutID = setTimeout(() => {
@ -284,6 +286,7 @@ export class AppComponent implements OnInit, OnDestroy {
}
public dropped(files: NgxFileDropEntry[]) {
this.settings.globalDropzoneActive = false
this.fileLeave(true)
this.uploadDocumentsService.uploadFiles(files)
this.toastService.showInfo($localize`Initiating upload...`, 3000)

View File

@ -6,6 +6,7 @@
<div class="col-auto col-lg-8 col-xl-9 mb-4">
<div class="row row-cols-1 g-4" tourAnchor="tour.dashboard"
dndDropzone
[dndDisableIf]="settingsService.globalDropzoneActive"
dndEffectAllowed="move"
(dndDrop)="onDrop($event)"
>

View File

@ -40,11 +40,6 @@ export class DashboardComponent extends ComponentWithPermissions {
)
.filter((v) => v)
: [...this.savedViewService.dashboardViews]
console.log(
this.dashboardViews,
sorted,
this.savedViewService.dashboardViews
)
})
}

View File

@ -56,6 +56,7 @@ export class SettingsService {
}
public globalDropzoneEnabled: boolean = true
public globalDropzoneActive: boolean = false
constructor(
rendererFactory: RendererFactory2,