Merge pull request #8465 from opf/fix/33247-Cannot-drag-and-drop-work-package-outside-of-currently-displayed-browser-window

[33247] Cannot drag & drop work package outside of currently displayed browser window

[ci skip]
pull/8477/head
Oliver Günther 4 years ago committed by GitHub
commit 42542ac483
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 11
      frontend/src/app/modules/common/drag-and-drop/dom-autoscroll.service.ts
  2. 7
      frontend/src/app/modules/common/drag-and-drop/drag-and-drop.service.ts

@ -45,8 +45,15 @@ export class DomAutoscrollService {
this.cleanAnimation();
}
public add(el:Element) {
this.elements.push(el);
public add(el:Element|Element[]) {
if (Array.isArray(el)) {
this.elements = this.elements.concat(el);
// Remove duplicates
this.elements = Array.from(new Set(this.elements));
} else {
this.elements.push(el);
}
}
public onUp() {

@ -71,14 +71,15 @@ export class DragAndDropService implements OnDestroy {
public register(member:DragMember) {
this.members.push(member);
const dragContainer = member.dragContainer;
const scrollContainers = member.scrollContainers;
if (this.autoscroll) {
this.autoscroll.add(dragContainer);
this.autoscroll.add(scrollContainers);
} else {
this.setupAutoscroll([dragContainer]);
this.setupAutoscroll(scrollContainers);
}
const dragContainer = member.dragContainer;
if (this.drake === null) {
this.initializeDrake([dragContainer]);
} else {

Loading…
Cancel
Save