|
8 | 8 | IgxInsertDropStrategy, |
9 | 9 | IDragBaseEventArgs, |
10 | 10 | IgxDragLocation, |
11 | | - DragDirection |
| 11 | + DragDirection, |
| 12 | + IDropDroppedEventArgs |
12 | 13 | } from 'igniteui-angular'; |
13 | 14 |
|
14 | 15 | @Component({ |
@@ -50,6 +51,12 @@ export class DragDropSampleComponent { |
50 | 51 | @ViewChild('toggleForm', { read: IgxDragDirective, static: true }) |
51 | 52 | public toggleFormDrag: IgxDragDirective; |
52 | 53 |
|
| 54 | + @ViewChild('toggleForm1', { static: true }) |
| 55 | + public toggleForm1: IgxToggleDirective; |
| 56 | + |
| 57 | + @ViewChild('toggleForm', { read: IgxDragDirective, static: true }) |
| 58 | + public toggleFormDrag1: IgxDragDirective; |
| 59 | + |
53 | 60 | @ViewChildren('listItem', { read: IgxDragDirective }) |
54 | 61 | public listNotesDirs: QueryList<IgxDragDirective>; |
55 | 62 |
|
@@ -168,6 +175,22 @@ export class DragDropSampleComponent { |
168 | 175 | this.toggleFormDrag.setLocation(new IgxDragLocation(this.toggleStartPageX, this.toggleStartPageY)); |
169 | 176 | } |
170 | 177 |
|
| 178 | + public openOverlappingDialog() { |
| 179 | + const overlaySettings: OverlaySettings = { |
| 180 | + positionStrategy: new GlobalPositionStrategy(), |
| 181 | + scrollStrategy: new NoOpScrollStrategy(), |
| 182 | + modal: false, |
| 183 | + closeOnOutsideClick: false |
| 184 | + }; |
| 185 | + this.toggleForm1.open(overlaySettings); |
| 186 | + |
| 187 | + if (!this.toggleStartPageX && !this.toggleStartPageY) { |
| 188 | + this.toggleStartPageX = this.toggleFormDrag.pageX; |
| 189 | + this.toggleStartPageY = this.toggleFormDrag.pageY; |
| 190 | + } |
| 191 | + this.toggleFormDrag.setLocation(new IgxDragLocation(this.toggleStartPageX, this.toggleStartPageY)); |
| 192 | + } |
| 193 | + |
171 | 194 | public toOriginNoGhost() { |
172 | 195 | const startX = this.startX.nativeElement.value; |
173 | 196 | const startY = this.startY.nativeElement.value; |
@@ -375,4 +398,18 @@ export class DragDropSampleComponent { |
375 | 398 | public dragClick() { |
376 | 399 | console.log('click'); |
377 | 400 | } |
| 401 | + |
| 402 | + public onDragMove(e) { |
| 403 | + const deltaX = e.nextPageX - e.pageX; |
| 404 | + const deltaY = e.nextPageY - e.pageY; |
| 405 | + e.cancel = true; |
| 406 | + this.toggleForm.setOffset(deltaX, deltaY); |
| 407 | + } |
| 408 | + |
| 409 | + public onItemDropped(event: IDropDroppedEventArgs) { |
| 410 | + const dropDivArea: HTMLElement = event.owner.element.nativeElement; |
| 411 | + const draggedEl = event.drag.element.nativeElement; |
| 412 | + dropDivArea.appendChild(draggedEl); |
| 413 | + event.cancel = true; |
| 414 | + } |
378 | 415 | } |
0 commit comments