aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHakim El Hattab <hakim.elhattab@gmail.com>2018-05-31 10:35:07 +0200
committerHakim El Hattab <hakim.elhattab@gmail.com>2018-05-31 10:35:09 +0200
commit4672801229e58cb85f10309c43827050e23649ed (patch)
tree56ff75aba4905cc76679e4db2d37374c819b9fba
parent30b670cf42c458b80d0af22abeb5162507229061 (diff)
downloadperl-software-in-gnu-guix-4672801229e58cb85f10309c43827050e23649ed.tar
perl-software-in-gnu-guix-4672801229e58cb85f10309c43827050e23649ed.tar.gz
new syncFragments api method
-rw-r--r--js/reveal.js18
1 files changed, 16 insertions, 2 deletions
diff --git a/js/reveal.js b/js/reveal.js
index 0f40977..ed9db7b 100644
--- a/js/reveal.js
+++ b/js/reveal.js
@@ -2682,8 +2682,7 @@
function syncSlide( slide ) {
syncBackground( slide );
-
- sortFragments( slide.querySelectorAll( '.fragment' ) );
+ syncFragments( slide );
updateBackground();
updateNotes();
@@ -2693,6 +2692,19 @@
}
/**
+ * Formats the fragments on the given slide so that they have
+ * valid indices. Call this if fragments are changed in the DOM
+ * after reveal.js has already initialized.
+ *
+ * @param {HTMLElement} slide
+ */
+ function syncFragments( slide ) {
+
+ sortFragments( slide.querySelectorAll( '.fragment' ) );
+
+ }
+
+ /**
* Resets all vertical slides so that only the first
* is visible.
*/
@@ -5297,8 +5309,10 @@
initialize: initialize,
configure: configure,
+
sync: sync,
syncSlide: syncSlide,
+ syncFragments: syncFragments,
// Navigation methods
slide: slide,