瀏覽代碼

tidy up code for #2940

Hakim El Hattab 4 年之前
父節點
當前提交
236d3e3722
共有 3 個文件被更改,包括 3 次插入7 次删除
  1. 0 0
      dist/reveal.esm.js
  2. 0 0
      dist/reveal.js
  3. 3 7
      js/controllers/slidecontent.js

文件差異過大導致無法顯示
+ 0 - 0
dist/reveal.esm.js


文件差異過大導致無法顯示
+ 0 - 0
dist/reveal.js


+ 3 - 7
js/controllers/slidecontent.js

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

部分文件因文件數量過多而無法顯示