IE 11 support
Added un-prefixed touch-action CSS attribute added un-prefixed PointerEvents event handler hooks
This commit is contained in:
parent
9cf7de54b8
commit
27a86d261e
@ -487,6 +487,7 @@ body {
|
||||
height: 100%;
|
||||
|
||||
-ms-touch-action: none;
|
||||
touch-action: none;
|
||||
}
|
||||
|
||||
.reveal .slides {
|
||||
|
2
css/reveal.min.css
vendored
2
css/reveal.min.css
vendored
File diff suppressed because one or more lines are too long
20
js/reveal.js
20
js/reveal.js
@ -567,11 +567,18 @@ var Reveal = (function(){
|
||||
dom.wrapper.addEventListener( 'touchend', onTouchEnd, false );
|
||||
|
||||
// Support pointer-style touch interaction as well
|
||||
// IE 10 uses prefixed version of pointer events
|
||||
if( window.navigator.msPointerEnabled ) {
|
||||
dom.wrapper.addEventListener( 'MSPointerDown', onPointerDown, false );
|
||||
dom.wrapper.addEventListener( 'MSPointerMove', onPointerMove, 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 ) {
|
||||
@ -608,11 +615,18 @@ var Reveal = (function(){
|
||||
dom.wrapper.removeEventListener( 'touchmove', onTouchMove, false );
|
||||
dom.wrapper.removeEventListener( 'touchend', onTouchEnd, false );
|
||||
|
||||
// IE10
|
||||
if( window.navigator.msPointerEnabled ) {
|
||||
dom.wrapper.removeEventListener( 'MSPointerDown', onPointerDown, false );
|
||||
dom.wrapper.removeEventListener( 'MSPointerMove', onPointerMove, false );
|
||||
dom.wrapper.removeEventListener( 'MSPointerUp', onPointerUp, false );
|
||||
}
|
||||
// IE11
|
||||
if( window.navigator.pointerEnabled ) {
|
||||
dom.wrapper.removeEventListener( 'pointerdown', onPointerDown, false );
|
||||
dom.wrapper.removeEventListener( 'pointermove', onPointerMove, false );
|
||||
dom.wrapper.removeEventListener( 'pointerup', onPointerUp, false );
|
||||
}
|
||||
|
||||
if ( config.progress && dom.progress ) {
|
||||
dom.progress.removeEventListener( 'click', onProgressClicked, false );
|
||||
@ -2492,7 +2506,7 @@ var Reveal = (function(){
|
||||
*/
|
||||
function onPointerDown( event ) {
|
||||
|
||||
if( event.pointerType === event.MSPOINTER_TYPE_TOUCH ) {
|
||||
if(( event.pointerType === event.MSPOINTER_TYPE_TOUCH ) || ( event.pointerType === "touch" )) {
|
||||
event.touches = [{ clientX: event.clientX, clientY: event.clientY }];
|
||||
onTouchStart( event );
|
||||
}
|
||||
@ -2504,7 +2518,7 @@ var Reveal = (function(){
|
||||
*/
|
||||
function onPointerMove( event ) {
|
||||
|
||||
if( event.pointerType === event.MSPOINTER_TYPE_TOUCH ) {
|
||||
if(( event.pointerType === event.MSPOINTER_TYPE_TOUCH ) || ( event.pointerType === "touch" )) {
|
||||
event.touches = [{ clientX: event.clientX, clientY: event.clientY }];
|
||||
onTouchMove( event );
|
||||
}
|
||||
@ -2516,7 +2530,7 @@ var Reveal = (function(){
|
||||
*/
|
||||
function onPointerUp( event ) {
|
||||
|
||||
if( event.pointerType === event.MSPOINTER_TYPE_TOUCH ) {
|
||||
if(( event.pointerType === event.MSPOINTER_TYPE_TOUCH ) || ( event.pointerType === "touch" )) {
|
||||
event.touches = [{ clientX: event.clientX, clientY: event.clientY }];
|
||||
onTouchEnd( event );
|
||||
}
|
||||
|
4
js/reveal.min.js
vendored
4
js/reveal.min.js
vendored
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue
Block a user