aboutsummaryrefslogtreecommitdiff
path: root/js
diff options
context:
space:
mode:
authorMaarten Schroeven <maarten.schroeven@kbc.be>2016-08-18 10:40:56 +0200
committerHakim El Hattab <hakim.elhattab@gmail.com>2016-10-05 11:54:46 +0200
commitab33b31f0a2892852903785893a4fa68862aa73d (patch)
tree2491c4f80e43171ac37394f64f4fc512019852a8 /js
parent2cf00254a1a696111b0f4a48dda1cac399447193 (diff)
downloadfreenode-live-2017-presentation-ab33b31f0a2892852903785893a4fa68862aa73d.tar
freenode-live-2017-presentation-ab33b31f0a2892852903785893a4fa68862aa73d.tar.gz
limit text written to the status div
Diffstat (limited to 'js')
-rw-r--r--js/reveal.js21
1 files changed, 19 insertions, 2 deletions
diff --git a/js/reveal.js b/js/reveal.js
index 186b438..b0bc935 100644
--- a/js/reveal.js
+++ b/js/reveal.js
@@ -554,6 +554,23 @@
}
+ function getStatusText(node) {
+ var text = "";
+ if(node.nodeType === 3) { //text node
+ text += node.textContent;
+ }else {
+ var isAriaHidden = node.getAttribute('aria-hidden');
+ var isDisplayHidden = window.getComputedStyle(node)['display'] === 'none';
+ if (isAriaHidden !== 'true' && !isDisplayHidden) {
+ var children = node.childNodes;
+ for (var i = 0;i < children.length; i++) {
+ text += getStatusText(children[i]);
+ }
+ }
+ }
+ return text;
+ }
+
/**
* Configures the presentation for printing to a static
* PDF.
@@ -2256,7 +2273,7 @@
}
// Announce the current slide contents, for screen readers
- dom.statusDiv.textContent = currentSlide.textContent;
+ dom.statusDiv.textContent = getStatusText(currentSlide);
updateControls();
updateProgress();
@@ -3669,7 +3686,7 @@
element.classList.remove( 'current-fragment' );
// Announce the fragments one by one to the Screen Reader
- dom.statusDiv.textContent = element.textContent;
+ dom.statusDiv.textContent = getStatusText(element);
if( i === index ) {
element.classList.add( 'current-fragment' );