From 5a6e6d49c432041107c63130a15687a5fe305fd1 Mon Sep 17 00:00:00 2001 From: Raphael Parree Date: Sun, 24 May 2020 11:16:00 +0200 Subject: [PATCH] merged with upstream 3.9.0 Includes a temporary fixes that need to be addressed later: RevealJs now enables `linearMode` when the slides are one-dimensional, This interferes with the hidden sections. It is forced to `false` for now --- js/reveal.js | 17 +++++------------ webyarns/lib/webyarn-plugin.min.js | 2 +- 2 files changed, 6 insertions(+), 13 deletions(-) diff --git a/js/reveal.js b/js/reveal.js index 437df76e022..bf71c6eda9f 100644 --- a/js/reveal.js +++ b/js/reveal.js @@ -5105,6 +5105,7 @@ } if( previousSlide ) { + // TODO fux this for hidden sections var v = ( previousSlide.querySelectorAll( 'section' ).length - 1 ) || undefined; var h = indexh - 1; slide( h, v ); @@ -5271,6 +5272,8 @@ // the presentation is one-dimensional var useLinearMode = config.navigationMode === 'linear' || !hasHorizontalSlides() || !hasVerticalSlides(); + //webyarn temporary fix + useLinearMode=false var triggered = false; // 1. User defined key bindings @@ -5511,21 +5514,11 @@ } else if( deltaY > touch.threshold ) { touch.captured = true; - if( config.navigationMode === 'linear' ) { - navigatePrev(); - } - else { - navigateUp(); - } + navigateUp(); } else if( deltaY < -touch.threshold ) { touch.captured = true; - if( config.navigationMode === 'linear' ) { - navigateNext(); - } - else { - navigateDown(); - } + navigateDown(); } // If we're embedded, only block touch events if they have diff --git a/webyarns/lib/webyarn-plugin.min.js b/webyarns/lib/webyarn-plugin.min.js index b458f35b6cc..748d2d6b981 100644 --- a/webyarns/lib/webyarn-plugin.min.js +++ b/webyarns/lib/webyarn-plugin.min.js @@ -1 +1 @@ -"use strict";var w=require("helpers")(function(){var e={init:function(){var e=document.createElement("style");document.head.appendChild(e),function(e){e.insertRule("a[data-link-indexh] { cursor: pointer }",0),document.querySelectorAll("a[data-link-indexh]").forEach(function(i){return i.addEventListener("click",function(e){e.preventDefault();var t=i.getAttribute("data-link-indexh");if(t){var n=parseInt(t,10);Reveal.slide(n)}})})}(e.sheet),Reveal.addEventListener("slidechanged",function(e){var n=e.currentSlide.getAttribute("data-auto-move-to");if(n){var t=1e3*e.currentSlide.getAttribute("data-auto-move-time-sec")|3e3,i=setTimeout(function(){if("next"===n)Reveal.next();else if("prev"===n)Reveal.prev();else if("#"===n.charAt(0))document.location.hash=n;else if(function(e){return/^\d+$/.test(e)}(n)){var e=parseInt(n,10)-1;Reveal.slide(e)}else{var t=Webyarns.lookupIndex(n);-1===t&&console.error("get not find slide with id",n),Reveal.slide(t)}},t);Reveal.addEventListener("slidechanged",function(){return clearTimeout(i)})}})}};Reveal.registerPlugin("WebyarnPlugin",e)})(); \ No newline at end of file +"use strict";!function(){var e={init:function(){var e=document.createElement("style");document.head.appendChild(e),function(e){e.insertRule("a[data-link-indexh] { cursor: pointer }",0),document.querySelectorAll("a[data-link-indexh]").forEach(function(i){return i.addEventListener("click",function(e){e.preventDefault();var t=i.getAttribute("data-link-indexh");if(t){var n=parseInt(t,10);Reveal.slide(n)}})})}(e.sheet),Reveal.addEventListener("slidechanged",function(e){var n=e.currentSlide.getAttribute("data-auto-move-to");if(n){var t=1e3*e.currentSlide.getAttribute("data-auto-move-time-sec")|3e3,i=setTimeout(function(){if("next"===n)Reveal.next();else if("prev"===n)Reveal.prev();else if("#"===n.charAt(0))document.location.hash=n;else if(function(e){return/^\d+$/.test(e)}(n)){var e=parseInt(n,10)-1;Reveal.slide(e)}else{var t=Webyarns.lookupIndex(n);-1===t&&console.error("get not find slide with id",n),Reveal.slide(t)}},t);Reveal.addEventListener("slidechanged",function(){return clearTimeout(i)})}})}};Reveal.registerPlugin("WebyarnPlugin",e)}(); \ No newline at end of file