aboutsummaryrefslogtreecommitdiff
path: root/js
diff options
context:
space:
mode:
authorHakim El Hattab <hakim.elhattab@gmail.com>2014-09-09 17:18:15 +0200
committerHakim El Hattab <hakim.elhattab@gmail.com>2014-09-09 17:18:15 +0200
commit9fb0c5f3d3df1b207c444114a3ea0a6dc909cde4 (patch)
treebdfa606ed375a0c122adcdd0209381d0fc31dc14 /js
parent20e72df4bf3f284604e15c6384983055b3641baa (diff)
downloadfosdem-2018-presentation-9fb0c5f3d3df1b207c444114a3ea0a6dc909cde4.tar
fosdem-2018-presentation-9fb0c5f3d3df1b207c444114a3ea0a6dc909cde4.tar.gz
use computed style when calculating bg birghtness
Diffstat (limited to 'js')
-rw-r--r--js/reveal.js7
1 files changed, 4 insertions, 3 deletions
diff --git a/js/reveal.js b/js/reveal.js
index df4e8a0..24093e4 100644
--- a/js/reveal.js
+++ b/js/reveal.js
@@ -714,15 +714,16 @@
if( data.backgroundPosition ) element.style.backgroundPosition = data.backgroundPosition;
if( data.backgroundTransition ) element.setAttribute( 'data-background-transition', data.backgroundTransition );
+ container.appendChild( element );
+
// If this slide has a background color, add a class that
// signals if it is light
- if( element.style.backgroundColor && colorBrightness( element.style.backgroundColor ) > 128 ) {
+ var computedBackgroundColor = window.getComputedStyle( element ).backgroundColor;
+ if( computedBackgroundColor && colorBrightness( computedBackgroundColor ) > 128 ) {
slide.classList.add( 'is-background-light' );
element.classList.add( 'is-background-light' );
}
- container.appendChild( element );
-
return element;
}