windows.navigator.pointerEnabled

for backward compatibility reasons, IE11 sets both msPointerEnabled and
pointerEnabled. Changed the order for the test and added 'else if' to
not duplicate handlers on pointer events
edit
olivierbloch 2013-10-01 15:15:10 -07:00
parent e608dafaf1
commit 27bf130611
3 changed files with 11 additions and 23 deletions

6
css/reveal.min.css vendored

File diff suppressed because one or more lines are too long

View File

@ -595,18 +595,18 @@ var Reveal = (function(){
dom.wrapper.addEventListener( 'touchend', onTouchEnd, false ); dom.wrapper.addEventListener( 'touchend', onTouchEnd, false );
// Support pointer-style touch interaction as well // Support pointer-style touch interaction as well
// IE 10 uses prefixed version of pointer events if( window.navigator.pointerEnabled ) {
if( window.navigator.msPointerEnabled ) { // IE 11 uses un-prefixed version of pointer events
dom.wrapper.addEventListener( 'pointerdown', onPointerDown, false );
dom.wrapper.addEventListener( 'pointermove', onPointerMove, false );
dom.wrapper.addEventListener( 'pointerup', onPointerUp, false );
} else if( window.navigator.msPointerEnabled ) {
// IE 10 uses prefixed version of pointer events
dom.wrapper.addEventListener( 'MSPointerDown', onPointerDown, false ); dom.wrapper.addEventListener( 'MSPointerDown', onPointerDown, false );
dom.wrapper.addEventListener( 'MSPointerMove', onPointerMove, false ); dom.wrapper.addEventListener( 'MSPointerMove', onPointerMove, false );
dom.wrapper.addEventListener( 'MSPointerUp', onPointerUp, false ); dom.wrapper.addEventListener( 'MSPointerUp', onPointerUp, false );
} }
// IE 11 uses un-prefixed version of pointer events
if( window.navigator.pointerEnabled ) {
dom.wrapper.addEventListener( 'pointerdown', onPointerDown, false );
dom.wrapper.addEventListener( 'pointermove', onPointerMove, false );
dom.wrapper.addEventListener( 'pointerup', onPointerUp, false );
}
} }
if( config.keyboard ) { if( config.keyboard ) {

12
js/reveal.min.js vendored

File diff suppressed because one or more lines are too long