Procházet zdrojové kódy

support vertical align of slides with absolute children

Hakim El Hattab před 11 roky
rodič
revize
8b355eaba0
4 změnil soubory, kde provedl 36 přidání a 25 odebrání
  1. 0 4
      css/reveal.css
  2. 0 0
      css/reveal.min.css
  3. 35 20
      js/reveal.js
  4. 1 1
      js/reveal.min.js

+ 0 - 4
css/reveal.css

@@ -649,10 +649,6 @@ body {
 	        transition-duration: 1200ms;
 }
 
-.reveal .slides>section[data-full-height] {
-	height: 100%;
-}
-
 .reveal .slides>section {
 	left: -50%;
 	top: -50%;

Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 0 - 0
css/reveal.min.css


+ 35 - 20
js/reveal.js

@@ -535,6 +535,41 @@ var Reveal = (function(){
 
 	}
 
+	/**
+	 * Retrieves the height of the given element by looking
+	 * at the position and height of its immediate children.
+	 */
+	function getAbsoluteHeight( element ) {
+
+		var height = 0;
+
+		if( element ) {
+			var absoluteChildren = 0;
+
+			toArray( element.childNodes ).forEach( function( child ) {
+
+				if( typeof child.offsetTop === 'number' && child.style ) {
+					// Count # of abs children
+					if( child.style.position === 'absolute' ) {
+						absoluteChildren += 1;
+					}
+
+					height = Math.max( height, child.offsetTop + child.offsetHeight );
+				}
+
+			} );
+
+			// If there are no absolute children, use offsetHeight
+			if( absoluteChildren === 0 ) {
+				height = element.offsetHeight;
+			}
+
+		}
+
+		return height;
+
+	}
+
 	/**
 	 * Causes the address bar to hide on mobile devices,
 	 * more vertical space ftw.
@@ -613,26 +648,6 @@ var Reveal = (function(){
 
 	}
 
-	/**
-	 * Retrieves the height of the given element by looking
-	 * at the position and height of its immediate children.
-	 */
-	function getAbsoluteHeight( element ) {
-
-		var height = 0;
-
-		if( element ) {
-
-			toArray( element.childNodes ).forEach( function( child ) {
-				height = Math.max( height, child.offsetTop + child.offsetHeight );
-			} );
-
-		}
-
-		return height;
-
-	}
-
 	/**
 	 * Bind preview frame links.
 	 */

Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 1 - 1
js/reveal.min.js


Některé soubory nejsou zobrazeny, neboť je v těchto rozdílových datech změněno mnoho souborů