support vertical align of slides with absolute children

master
Hakim El Hattab 2013-05-20 00:29:34 -04:00
parent de551634c6
commit 8b355eaba0
4 changed files with 38 additions and 27 deletions

View File

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

2
css/reveal.min.css vendored

File diff suppressed because one or more lines are too long

View File

@ -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.
*/

4
js/reveal.min.js vendored

File diff suppressed because one or more lines are too long