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() {
|
public fileOver() {
|
||||||
|
this.settings.globalDropzoneActive = true
|
||||||
// allows transition
|
// allows transition
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
this.fileIsOver = true
|
this.fileIsOver = true
|
||||||
@ -272,6 +273,7 @@ export class AppComponent implements OnInit, OnDestroy {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public fileLeave(immediate: boolean = false) {
|
public fileLeave(immediate: boolean = false) {
|
||||||
|
this.settings.globalDropzoneActive = false
|
||||||
const ms = immediate ? 0 : 500
|
const ms = immediate ? 0 : 500
|
||||||
|
|
||||||
this.fileLeaveTimeoutID = setTimeout(() => {
|
this.fileLeaveTimeoutID = setTimeout(() => {
|
||||||
@ -284,6 +286,7 @@ export class AppComponent implements OnInit, OnDestroy {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public dropped(files: NgxFileDropEntry[]) {
|
public dropped(files: NgxFileDropEntry[]) {
|
||||||
|
this.settings.globalDropzoneActive = false
|
||||||
this.fileLeave(true)
|
this.fileLeave(true)
|
||||||
this.uploadDocumentsService.uploadFiles(files)
|
this.uploadDocumentsService.uploadFiles(files)
|
||||||
this.toastService.showInfo($localize`Initiating upload...`, 3000)
|
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="col-auto col-lg-8 col-xl-9 mb-4">
|
||||||
<div class="row row-cols-1 g-4" tourAnchor="tour.dashboard"
|
<div class="row row-cols-1 g-4" tourAnchor="tour.dashboard"
|
||||||
dndDropzone
|
dndDropzone
|
||||||
|
[dndDisableIf]="settingsService.globalDropzoneActive"
|
||||||
dndEffectAllowed="move"
|
dndEffectAllowed="move"
|
||||||
(dndDrop)="onDrop($event)"
|
(dndDrop)="onDrop($event)"
|
||||||
>
|
>
|
||||||
|
@ -40,11 +40,6 @@ export class DashboardComponent extends ComponentWithPermissions {
|
|||||||
)
|
)
|
||||||
.filter((v) => v)
|
.filter((v) => v)
|
||||||
: [...this.savedViewService.dashboardViews]
|
: [...this.savedViewService.dashboardViews]
|
||||||
console.log(
|
|
||||||
this.dashboardViews,
|
|
||||||
sorted,
|
|
||||||
this.savedViewService.dashboardViews
|
|
||||||
)
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -56,6 +56,7 @@ export class SettingsService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public globalDropzoneEnabled: boolean = true
|
public globalDropzoneEnabled: boolean = true
|
||||||
|
public globalDropzoneActive: boolean = false
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
rendererFactory: RendererFactory2,
|
rendererFactory: RendererFactory2,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user