1
0
Эх сурвалжийг харах

Merge pull request #3810 from phwebi/update-display-config

Update `display` config to support `!important` flag.
Hakim El Hattab 3 долоо хоног өмнө
parent
commit
4cf184924d

+ 7 - 1
js/controllers/slidecontent.js

@@ -52,7 +52,13 @@ export default class SlideContent {
 	load( slide, options = {} ) {
 
 		// Show the slide element
-		slide.style.display = this.Reveal.getConfig().display;
+		const displayValue = this.Reveal.getConfig().display;
+		if( displayValue.includes('!important') ) {
+			const value = displayValue.replace(/\s*!important\s*$/, '').trim();
+			slide.style.setProperty('display', value, 'important');
+		} else {
+			slide.style.display = displayValue;
+		}
 
 		// Media elements with data-src attributes
 		queryAll( slide, 'img[data-src], video[data-src], audio[data-src], iframe[data-src]' ).forEach( element => {