@@ -50,13 +50,13 @@ export class NodeDraggableDirective implements OnDestroy {
5050
5151 private handleDragEnter ( e : DragEvent ) : any {
5252 e . preventDefault ( ) ;
53- if ( this . containsElementAt ( e . pageX , e . pageY ) ) {
53+ if ( this . containsElementAt ( e ) ) {
5454 this . addClass ( 'over-drop-target' ) ;
5555 }
5656 }
5757
5858 private handleDragLeave ( e : DragEvent ) : any {
59- if ( ! this . containsElementAt ( e . pageX , e . pageY ) ) {
59+ if ( ! this . containsElementAt ( e ) ) {
6060 this . removeClass ( 'over-drop-target' ) ;
6161 }
6262 }
@@ -78,15 +78,18 @@ export class NodeDraggableDirective implements OnDestroy {
7878
7979 private isDropPossible ( e : DragEvent ) {
8080 const capturedNode = this . nodeDraggableService . getCapturedNode ( ) ;
81- return capturedNode && capturedNode . canBeDroppedAt ( this . nodeDraggable ) && this . containsElementAt ( e . pageX , e . pageY ) ;
81+ return capturedNode
82+ && capturedNode . canBeDroppedAt ( this . nodeDraggable )
83+ && this . containsElementAt ( e ) ;
8284 }
8385
8486 private handleDragEnd ( e : DragEvent ) : any {
8587 this . removeClass ( 'over-drop-target' ) ;
8688 this . nodeDraggableService . releaseCapturedNode ( ) ;
8789 }
8890
89- private containsElementAt ( x : number , y : number ) : boolean {
91+ private containsElementAt ( e : DragEvent ) : boolean {
92+ const { x = e . clientX , y = e . clientY } = e ;
9093 return this . nodeNativeElement . contains ( document . elementFromPoint ( x , y ) ) ;
9194 }
9295
0 commit comments