Преглед на файлове

refactor code to match new background dom structure

Hakim El Hattab преди 6 години
родител
ревизия
667c83f1b7
променени са 1 файла, в които са добавени 11 реда и са изтрити 6 реда
  1. 11 6
      js/reveal.js

+ 11 - 6
js/reveal.js

@@ -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