Browse Source

IE11 Support

Added unprefixed touch-action CSS attribute
Added unprefixed pointer events handlers hooks
olivierbloch 11 years ago
parent
commit
e608dafaf1
5 changed files with 39 additions and 3 deletions
  1. 17 0
      README.md
  2. 1 0
      css/reveal.css
  3. 0 0
      css/reveal.min.css
  4. 17 3
      js/reveal.js
  5. 4 0
      js/reveal.min.js

+ 17 - 0
README.md

@@ -820,6 +820,23 @@ You can change the port by using `grunt serve --port 8001`.
 - **lib/** All other third party assets (JavaScript, CSS, fonts)
 
 
+### Contributing
+
+Please keep the [issue tracker](github.com/hakimel/reveal.js/issues) limited to **bug reports**, **feature requests** and **pull requests**. If you are reporting a bug make sure to include information about which browser and operating system you are using as well as the necessary steps to reproduce the issue.
+
+If you have personal support questions use [StackOverflow](http://stackoverflow.com/questions/tagged/reveal.js).
+
+
+#### Pull requests
+
+- Should follow the coding style
+  - Tabs to indent
+  - Single-quoted strings
+  - No space between function name and opening argument parenthesis
+  - One space after opening and before closing parenthesis 
+- Should be made towards the **dev branch**
+- Should be submitted from a feature/topic branch (not your master)
+
 
 ## License
 

+ 1 - 0
css/reveal.css

@@ -487,6 +487,7 @@ body {
 	height: 100%;
 
 	-ms-touch-action: none;
+		touch-action: none;
 }
 
 .reveal .slides {

File diff suppressed because it is too large
+ 0 - 0
css/reveal.min.css


+ 17 - 3
js/reveal.js

@@ -595,11 +595,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 ) {
@@ -636,11 +643,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 );
@@ -2557,7 +2571,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 );
 		}
@@ -2569,7 +2583,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 );
 		}
@@ -2581,7 +2595,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 );
 		}

File diff suppressed because it is too large
+ 4 - 0
js/reveal.min.js


Some files were not shown because too many files changed in this diff