Browse Source

prevent accidental swipe gestures when scrubbing video/audio timelines

Hakim El Hattab 4 years ago
parent
commit
be110fad11
3 changed files with 4 additions and 0 deletions
  1. 0 0
      dist/reveal.esm.js
  2. 0 0
      dist/reveal.js
  3. 4 0
      js/controllers/touch.js

File diff suppressed because it is too large
+ 0 - 0
dist/reveal.esm.js


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


+ 4 - 0
js/controllers/touch.js

@@ -1,4 +1,5 @@
 import { isAndroid } from '../utils/device.js'
+import { matches } from '../utils/util.js'
 
 const SWIPE_THRESHOLD = 40;
 
@@ -82,6 +83,9 @@ export default class Touch {
 	 */
 	isSwipePrevented( target ) {
 
+		// Prevent accidental swipes when scrubbing timelines
+		if( matches( target, 'video, audio' ) ) return true;
+
 		while( target && typeof target.hasAttribute === 'function' ) {
 			if( target.hasAttribute( 'data-prevent-swipe' ) ) return true;
 			target = target.parentNode;

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