File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed
projects/angular2-draggable/src/lib/models Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -7,7 +7,12 @@ export class Position implements IPosition {
77 constructor ( public x : number , public y : number ) { }
88
99 static fromEvent ( e : MouseEvent | TouchEvent , el : any = null ) {
10- if ( e instanceof MouseEvent ) {
10+ /**
11+ * Fix issue: Resize doesn't work on Windows10 IE11 (and on some windows 7 IE11)
12+ * https://github.com/xieziyu/angular2-draggable/issues/164
13+ * e instanceof MouseEvent check returns false on IE11
14+ */
15+ if ( this . isMouseEvent ( e ) ) {
1116 return new Position ( e . clientX , e . clientY ) ;
1217 } else {
1318 if ( el === null || e . changedTouches . length === 1 ) {
@@ -26,6 +31,10 @@ export class Position implements IPosition {
2631 }
2732 }
2833
34+ static isMouseEvent ( e : MouseEvent | TouchEvent ) : e is MouseEvent {
35+ return Object . prototype . toString . apply ( e ) . indexOf ( 'MouseEvent' ) === 8 ;
36+ }
37+
2938 static isIPosition ( obj ) : obj is IPosition {
3039 return ! ! obj && ( 'x' in obj ) && ( 'y' in obj ) ;
3140 }
You can’t perform that action at this time.
0 commit comments