refactor code to match new background dom structure

This commit is contained in:
Hakim El Hattab 2018-05-03 15:45:31 +02:00
parent 0bbcc6b594
commit 667c83f1b7

View file

@ -3237,13 +3237,18 @@
startEmbeddedContent( currentBackground ); 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) // Restart GIFs (doesn't work in Firefox)
if( /\.gif/i.test( backgroundImageURL ) ) { if( /\.gif/i.test( backgroundImageURL ) ) {
currentBackground.style.backgroundImage = ''; currentBackgroundContent.style.backgroundImage = '';
window.getComputedStyle( currentBackground ).opacity; window.getComputedStyle( currentBackgroundContent ).opacity;
currentBackground.style.backgroundImage = backgroundImageURL; currentBackgroundContent.style.backgroundImage = backgroundImageURL;
}
} }
// Don't transition between identical backgrounds. This // Don't transition between identical backgrounds. This