Skip to content

Commit

Permalink
Some versions of IE on some versions of Windows report `event.pointer…
Browse files Browse the repository at this point in the history
…Type` as an int #1931 #1933
  • Loading branch information
maxkfranz committed Aug 16, 2017
1 parent 043c099 commit 762b4fe
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/extensions/renderer/base/load-listeners.js
Original file line number Diff line number Diff line change
Expand Up @@ -1984,8 +1984,12 @@ BRp.load = function(){
} );
};

var pointerIsMouse = function( e ){
return e.pointerType === 'mouse' || e.pointerType === 4;
};

r.registerBinding( r.container, 'pointerdown', function( e ){
if( e.pointerType === 'mouse' ){ return; } // mouse already handled
if( pointerIsMouse(e) ){ return; } // mouse already handled

e.preventDefault();

Expand All @@ -1996,7 +2000,7 @@ BRp.load = function(){
} );

r.registerBinding( r.container, 'pointerup', function( e ){
if( e.pointerType === 'mouse' ){ return; } // mouse already handled
if( pointerIsMouse(e) ){ return; } // mouse already handled

removePointer( e );

Expand All @@ -2005,7 +2009,7 @@ BRp.load = function(){
} );

r.registerBinding( r.container, 'pointercancel', function( e ){
if( e.pointerType === 'mouse' ){ return; } // mouse already handled
if( pointerIsMouse(e) ){ return; } // mouse already handled

removePointer( e );

Expand All @@ -2014,7 +2018,7 @@ BRp.load = function(){
} );

r.registerBinding( r.container, 'pointermove', function( e ){
if( e.pointerType === 'mouse' ){ return; } // mouse already handled
if( pointerIsMouse(e) ){ return; } // mouse already handled

e.preventDefault();

Expand Down

0 comments on commit 762b4fe

Please sign in to comment.