Browse Source

fix empty slide bug when all slides in a stack are hidden via data-visibility

Hakim El Hattab 1 năm trước cách đây
mục cha
commit
07a6cf1249
5 tập tin đã thay đổi với 12 bổ sung1 xóa
  1. 0 0
      dist/reveal.esm.js
  2. 0 0
      dist/reveal.esm.js.map
  3. 0 0
      dist/reveal.js
  4. 0 0
      dist/reveal.js.map
  5. 12 1
      js/reveal.js

Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 0 - 0
dist/reveal.esm.js


Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 0 - 0
dist/reveal.esm.js.map


Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 0 - 0
dist/reveal.js


Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 0 - 0
dist/reveal.js.map


+ 12 - 1
js/reveal.js

@@ -255,7 +255,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();
+				}
+
 			} );
 		}
 

Một số tệp đã không được hiển thị bởi vì quá nhiều tập tin thay đổi trong này khác