Browse Source

support vertical align of slides with absolute children

embed
Hakim El Hattab 12 years ago
parent
commit
8b355eaba0
  1. 4
      css/reveal.css
  2. 2
      css/reveal.min.css
  3. 55
      js/reveal.js
  4. 4
      js/reveal.min.js

4
css/reveal.css

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

2
css/reveal.min.css

File diff suppressed because one or more lines are too long

55
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, * Causes the address bar to hide on mobile devices,
* more vertical space ftw. * 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. * Bind preview frame links.
*/ */

4
js/reveal.min.js

File diff suppressed because one or more lines are too long
Loading…
Cancel
Save