From 03c3031cb4de22f2cd8070547c2bb8085d435c69 Mon Sep 17 00:00:00 2001 From: Hakim El Hattab Date: Wed, 10 Sep 2014 11:28:29 +0200 Subject: [PATCH] cleanup classes when backgrounds are synced --- js/reveal.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/js/reveal.js b/js/reveal.js index 3cc1cae..a0b92ac 100644 --- a/js/reveal.js +++ b/js/reveal.js @@ -716,6 +716,10 @@ container.appendChild( element ); + // If backgrounds are being recreated, clear old classes + slide.classList.remove( 'has-dark-background' ); + slide.classList.remove( 'has-light-background' ); + // If this slide has a background color, add a class that // signals if it is light or dark. If the slide has no background // color, no class will be set