Browse Source

Merge branch 'master' into feature/reader-mode

Hakim El Hattab 1 year ago
parent
commit
7108476911
6 changed files with 21 additions and 6 deletions
  1. 0 0
      dist/reveal.esm.js.map
  2. 14 3
      js/reveal.js
  3. 1 1
      package.json
  4. 0 0
      plugin/notes/notes.esm.js
  5. 0 0
      plugin/notes/notes.js
  6. 6 2
      plugin/notes/plugin.js

File diff suppressed because it is too large
+ 0 - 0
dist/reveal.esm.js.map


+ 14 - 3
js/reveal.js

@@ -287,7 +287,18 @@ export default function( revealElement, options ) {
 
 		if( !config.showHiddenSlides ) {
 			Util.queryAll( dom.wrapper, 'section[data-visibility="hidden"]' ).forEach( slide => {
-				slide.parentNode.removeChild( slide );
+				const parent = slide.parentNode;
+
+				// If this slide is part of a stack and that stack will be
+				// empty after removing the hidden slide, remove the entire
+				// stack
+				if( parent.childElementCount === 1 && /section/i.test( parent.nodeName ) ) {
+					parent.remove();
+				}
+				else {
+					slide.remove();
+				}
+
 			} );
 		}
 
@@ -473,8 +484,8 @@ export default function( revealElement, options ) {
 		dom.wrapper.setAttribute( 'data-background-transition', config.backgroundTransition );
 
 		// Expose our configured slide dimensions as custom props
-		dom.viewport.style.setProperty( '--slide-width', config.width + 'px' );
-		dom.viewport.style.setProperty( '--slide-height', config.height + 'px' );
+		dom.viewport.style.setProperty( '--slide-width', typeof config.width == 'string' ? config.width :  config.width + 'px' );
+		dom.viewport.style.setProperty( '--slide-height', typeof config.height == 'string' ? config.height :  config.height + 'px' );
 
 		if( config.shuffle ) {
 			shuffle();

+ 1 - 1
package.json

@@ -1,6 +1,6 @@
 {
   "name": "reveal.js",
-  "version": "4.6.0",
+  "version": "4.6.1",
   "description": "The HTML Presentation Framework",
   "homepage": "https://revealjs.com",
   "subdomain": "revealjs",

File diff suppressed because it is too large
+ 0 - 0
plugin/notes/notes.esm.js


File diff suppressed because it is too large
+ 0 - 0
plugin/notes/notes.js


+ 6 - 2
plugin/notes/plugin.js

@@ -146,8 +146,12 @@ const Plugin = () => {
 		}
 
 		// Look for notes defined in an aside element
-		if( notesElements ) {
-			messageData.notes = Array.from(notesElements).map( notesElement => notesElement.innerHTML ).join( '\n' );
+		if( notesElements && notesElements.length ) {
+			// Ignore notes inside of fragments since those are shown
+			// individually when stepping through fragments
+			notesElements = Array.from( notesElements ).filter( notesElement => notesElement.closest( '.fragment' ) === null );
+
+			messageData.notes = notesElements.map( notesElement => notesElement.innerHTML ).join( '\n' );
 			messageData.markdown = notesElements[0] && typeof notesElements[0].getAttribute( 'data-markdown' ) === 'string';
 		}
 

Some files were not shown because too many files changed in this diff