aboutsummaryrefslogtreecommitdiff
path: root/js
diff options
context:
space:
mode:
authorHakim El Hattab <hakim.elhattab@gmail.com>2016-04-20 13:45:03 +0200
committerHakim El Hattab <hakim.elhattab@gmail.com>2017-05-16 09:45:37 +0200
commit1319016957e806af362761e43bd389e6aa9edefe (patch)
tree61d801eb101df37bd722a18d475720b1b5f992af /js
parent963e5c8678d6529dfe796dd522e9d3d9dcf4cb08 (diff)
downloadfosdem-2018-presentation-1319016957e806af362761e43bd389e6aa9edefe.tar
fosdem-2018-presentation-1319016957e806af362761e43bd389e6aa9edefe.tar.gz
new optional controls aligned to screen edges
Diffstat (limited to 'js')
-rw-r--r--js/reveal.js14
1 files changed, 9 insertions, 5 deletions
diff --git a/js/reveal.js b/js/reveal.js
index d3ba03c..803c50a 100644
--- a/js/reveal.js
+++ b/js/reveal.js
@@ -516,7 +516,7 @@
dom.progressbar = dom.progress.querySelector( 'span' );
// Arrow controls
- createSingletonNode( dom.wrapper, 'aside', 'controls',
+ dom.controls = createSingletonNode( dom.wrapper, 'aside', 'controls',
'<button class="navigate-left" aria-label="previous slide"></button>' +
'<button class="navigate-right" aria-label="next slide"></button>' +
'<button class="navigate-up" aria-label="above slide"></button>' +
@@ -533,9 +533,6 @@
// Overlay graphic which is displayed during the paused mode
createSingletonNode( dom.wrapper, 'div', 'pause-overlay', null );
- // Cache references to elements
- dom.controls = document.querySelector( '.reveal .controls' );
-
dom.wrapper.setAttribute( 'role', 'application' );
// There can be multiple instances of controls throughout the page
@@ -789,7 +786,7 @@
// If no node was found, create it now
var node = document.createElement( tagname );
- node.classList.add( classname );
+ node.className = classname;
if( typeof innerHTML === 'string' ) {
node.innerHTML = innerHTML;
}
@@ -1001,6 +998,13 @@
dom.controls.style.display = config.controls ? 'block' : 'none';
dom.progress.style.display = config.progress ? 'block' : 'none';
+ var controlsType = typeof config.controls === 'string' ? config.controls : 'bottom-right';
+ dom.controls.setAttribute( 'data-controls-type', controlsType );
+
+ if( typeof config.controls === 'string' ) {
+ dom.controls.classList.add( config.controls );
+ }
+
if( config.shuffle ) {
shuffle();
}