Procházet zdrojové kódy

Merge pull request #2940 from cmeessen/fix_multiple_data-background

Fix: multiple image-urls in data-background-image
Hakim El Hattab před 4 roky
rodič
revize
a112712f12
1 změnil soubory, kde provedl 7 přidání a 1 odebrání
  1. 7 1
      js/controllers/slidecontent.js

+ 7 - 1
js/controllers/slidecontent.js

@@ -102,7 +102,13 @@ export default class SlideContent {
 
 				// Images
 				if( backgroundImage ) {
-					backgroundContent.style.backgroundImage = 'url('+ encodeURI( backgroundImage ) +')';
+					let backgroundString = '';
+					backgroundImage.split(',').forEach(background => {
+						backgroundString = backgroundString.concat(
+							'url(' + encodeURI(background.trim()) + '),'
+						);
+					});
+					backgroundContent.style.backgroundImage = backgroundString.substr(0, backgroundString.length - 1);
 				}
 				// Videos
 				else if ( backgroundVideo && !this.Reveal.isSpeakerNotes() ) {