From 8347a2de5818ecdce91b98325b3c85dda3b440fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20Mee=C3=9Fen?= <14222414+cmeessen@users.noreply.github.com> Date: Fri, 23 Apr 2021 08:33:56 +0000 Subject: [PATCH 1/2] Allow multiple data-background --- js/controllers/slidecontent.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/js/controllers/slidecontent.js b/js/controllers/slidecontent.js index 06cf6f16..3b3594da 100644 --- a/js/controllers/slidecontent.js +++ b/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() ) { From 5d8d673117eff72a668b9546e3e89d3b29bf0f73 Mon Sep 17 00:00:00 2001 From: cmeessen <14222414+cmeessen@users.noreply.github.com> Date: Fri, 23 Apr 2021 10:15:40 +0000 Subject: [PATCH 2/2] Add missing semicolons --- js/controllers/slidecontent.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/js/controllers/slidecontent.js b/js/controllers/slidecontent.js index 3b3594da..c6fa56a1 100644 --- a/js/controllers/slidecontent.js +++ b/js/controllers/slidecontent.js @@ -102,12 +102,12 @@ export default class SlideContent { // Images if( backgroundImage ) { - let backgroundString = '' + let backgroundString = ''; backgroundImage.split(',').forEach(background => { backgroundString = backgroundString.concat( 'url(' + encodeURI(background.trim()) + '),' ); - }) + }); backgroundContent.style.backgroundImage = backgroundString.substr(0, backgroundString.length - 1); } // Videos