Skip to content

Commit

Permalink
refactor code to match new background dom structure
Browse files Browse the repository at this point in the history
  • Loading branch information
hakimel committed May 3, 2018
1 parent 0bbcc6b commit 667c83f
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions js/reveal.js
Original file line number Diff line number Diff line change
Expand Up @@ -3237,13 +3237,18 @@

startEmbeddedContent( currentBackground );

var backgroundImageURL = currentBackground.style.backgroundImage || '';
var currentBackgroundContent = currentBackground.querySelector( '.slide-background-content' );
if( currentBackgroundContent ) {

var backgroundImageURL = currentBackgroundContent.style.backgroundImage || '';

// Restart GIFs (doesn't work in Firefox)
if( /\.gif/i.test( backgroundImageURL ) ) {
currentBackgroundContent.style.backgroundImage = '';
window.getComputedStyle( currentBackgroundContent ).opacity;
currentBackgroundContent.style.backgroundImage = backgroundImageURL;
}

// Restart GIFs (doesn't work in Firefox)
if( /\.gif/i.test( backgroundImageURL ) ) {
currentBackground.style.backgroundImage = '';
window.getComputedStyle( currentBackground ).opacity;
currentBackground.style.backgroundImage = backgroundImageURL;
}

// Don't transition between identical backgrounds. This
Expand Down

0 comments on commit 667c83f

Please sign in to comment.