Merge pull request #2940 from cmeessen/fix_multiple_data-background

Fix: multiple image-urls in data-background-image
This commit is contained in:
Hakim El Hattab 2021-04-28 08:55:30 +02:00 committed by GitHub
commit a112712f12
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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() ) {