소스 검색

add initial slide dom setup pass

Hakim El Hattab 10 년 전
부모
커밋
ac3f021a14
2개의 변경된 파일24개의 추가작업 그리고 1개의 파일을 삭제
  1. 23 0
      js/reveal.js
  2. 1 1
      js/reveal.min.js

+ 23 - 0
js/reveal.js

@@ -209,6 +209,26 @@ var Reveal = (function(){
 
 	}
 
+	/**
+	 * Iterates through and decorates slides DOM elements with
+	 * appropriate classes.
+	 */
+	function setupSlides() {
+
+		var horizontalSlides = toArray( document.querySelectorAll( HORIZONTAL_SLIDES_SELECTOR ) );
+		horizontalSlides.forEach( function( horizontalSlide ) {
+
+			var verticalSlides = toArray( horizontalSlide.querySelectorAll( 'section' ) );
+			verticalSlides.forEach( function( verticalSlide, y ) {
+
+				if( y > 0 ) verticalSlide.classList.add( 'future' );
+
+			} );
+
+		} );
+
+	}
+
 	/**
 	 * Finds and stores references to DOM elements which are
 	 * required by the presentation. If a required element is
@@ -438,6 +458,9 @@ var Reveal = (function(){
 		// Make sure we've got all the DOM elements we need
 		setupDOM();
 
+		// Decorate the slide DOM elements with state classes (past/future)
+		setupSlides();
+
 		// Updates the presentation to match the current configuration values
 		configure();
 

파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 1 - 1
js/reveal.min.js


이 변경점에서 너무 많은 파일들이 변경되어 몇몇 파일들은 표시되지 않았습니다.