Jelajahi Sumber

fix vertical swipe navigation not blocking page scrolling in embedded decks

Hakim El Hattab 1 tahun lalu
induk
melakukan
924bdb6305
8 mengubah file dengan 11 tambahan dan 1 penghapusan
  1. 6 1
      css/reveal.scss
  2. 0 0
      dist/reveal.css
  3. 0 0
      dist/reveal.esm.js
  4. 0 0
      dist/reveal.esm.js.map
  5. 0 0
      dist/reveal.js
  6. 0 0
      dist/reveal.js.map
  7. 2 0
      js/controllers/touch.js
  8. 3 0
      js/reveal.js

+ 6 - 1
css/reveal.scss

@@ -631,11 +631,16 @@ $controlsArrowAngleActive: 36deg;
 	touch-action: pinch-zoom;
 	touch-action: pinch-zoom;
 }
 }
 
 
-// Swiping on an embedded deck should not block page scrolling
+// Swiping on an embedded deck should not block page scrolling...
 .reveal.embedded {
 .reveal.embedded {
 	touch-action: pan-y;
 	touch-action: pan-y;
 }
 }
 
 
+// ... unless we're on a vertical slide
+.reveal.embedded.is-vertical-slide {
+	touch-action: none;
+}
+
 .reveal .slides {
 .reveal .slides {
 	position: absolute;
 	position: absolute;
 	width: 100%;
 	width: 100%;

File diff ditekan karena terlalu besar
+ 0 - 0
dist/reveal.css


File diff ditekan karena terlalu besar
+ 0 - 0
dist/reveal.esm.js


File diff ditekan karena terlalu besar
+ 0 - 0
dist/reveal.esm.js.map


File diff ditekan karena terlalu besar
+ 0 - 0
dist/reveal.js


File diff ditekan karena terlalu besar
+ 0 - 0
dist/reveal.js.map


+ 2 - 0
js/controllers/touch.js

@@ -103,6 +103,8 @@ export default class Touch {
 	 */
 	 */
 	onTouchStart( event ) {
 	onTouchStart( event ) {
 
 
+		this.touchCaptured = false;
+
 		if( this.isSwipePrevented( event.target ) ) return true;
 		if( this.isSwipePrevented( event.target ) ) return true;
 
 
 		this.touchStartX = event.touches[0].clientX;
 		this.touchStartX = event.touches[0].clientX;

+ 3 - 0
js/reveal.js

@@ -1446,6 +1446,9 @@ export default function( revealElement, options ) {
 		let currentHorizontalSlide = horizontalSlides[ indexh ],
 		let currentHorizontalSlide = horizontalSlides[ indexh ],
 			currentVerticalSlides = currentHorizontalSlide.querySelectorAll( 'section' );
 			currentVerticalSlides = currentHorizontalSlide.querySelectorAll( 'section' );
 
 
+		// Indicate when we're on a vertical slide
+		revealElement.classList.toggle( 'is-vertical-slide', currentVerticalSlides.length > 1 );
+
 		// Store references to the previous and current slides
 		// Store references to the previous and current slides
 		currentSlide = currentVerticalSlides[ indexv ] || currentHorizontalSlide;
 		currentSlide = currentVerticalSlides[ indexv ] || currentHorizontalSlide;
 
 

Beberapa file tidak ditampilkan karena terlalu banyak file yang berubah dalam diff ini