Skip to content

Commit

Permalink
Merge pull request #2940 from cmeessen/fix_multiple_data-background
Browse files Browse the repository at this point in the history
Fix: multiple image-urls in data-background-image
  • Loading branch information
hakimel authored Apr 28, 2021
2 parents f5faeba + 5d8d673 commit a112712
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion js/controllers/slidecontent.js
Original file line number Diff line number Diff line change
Expand Up @@ -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() ) {
Expand Down

0 comments on commit a112712

Please sign in to comment.