Disable dashbaord dnd if global dnd active
This commit is contained in:
parent
737da43978
commit
a4c5d0429f
@ -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)
|
||||
|
@ -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)"
|
||||
>
|
||||
|
@ -40,11 +40,6 @@ export class DashboardComponent extends ComponentWithPermissions {
|
||||
)
|
||||
.filter((v) => v)
|
||||
: [...this.savedViewService.dashboardViews]
|
||||
console.log(
|
||||
this.dashboardViews,
|
||||
sorted,
|
||||
this.savedViewService.dashboardViews
|
||||
)
|
||||
})
|
||||
}
|
||||
|
||||
|
@ -56,6 +56,7 @@ export class SettingsService {
|
||||
}
|
||||
|
||||
public globalDropzoneEnabled: boolean = true
|
||||
public globalDropzoneActive: boolean = false
|
||||
|
||||
constructor(
|
||||
rendererFactory: RendererFactory2,
|
||||
|
Loading…
x
Reference in New Issue
Block a user