aboutsummaryrefslogtreecommitdiffhomepage
path: root/js/reveal.js
diff options
context:
space:
mode:
authorHakim El Hattab2012-11-10 10:02:19 -0500
committerHakim El Hattab2012-11-10 10:02:19 -0500
commit794ad868093849bf4dbcd6d45ccc5f3b8b6fb76c (patch)
treeffc06e32956e5539590dd0e9d4a15413054c4d58 /js/reveal.js
parent691099c6a25861405f067d3b1f7c669c4642a535 (diff)
corrections to vertical centering (#70), added to docs, upgrade to 2.2
Diffstat (limited to 'js/reveal.js')
-rw-r--r--js/reveal.js11
1 files changed, 8 insertions, 3 deletions
diff --git a/js/reveal.js b/js/reveal.js
index a1683ec..564c863 100644
--- a/js/reveal.js
+++ b/js/reveal.js
@@ -1,5 +1,5 @@
/*!
- * reveal.js 2.1 r37
+ * reveal.js 2.2 r38
* http://lab.hakim.se/reveal-js
* MIT licensed
*
@@ -29,6 +29,7 @@ var Reveal = (function(){
// Enable the slide overview mode
overview: true,
+ // Vertical centering of slides
center: false,
// Loop the presentation
@@ -465,6 +466,7 @@ var Reveal = (function(){
* presentation.
*/
function layout() {
+
if( config.center ) {
// Select all slides, vertical and horizontal
@@ -476,15 +478,18 @@ var Reveal = (function(){
for( var i = 0, len = slides.length; i < len; i++ ) {
var slide = slides[ i ];
+ // Vertical stacks are not centered since their section
+ // children will be
if( slide.classList.contains( 'stack' ) ) {
- slide.style.marginTop = 0;
+ slide.style.top = 0;
}
else {
- slide.style.marginTop = Math.max( - ( slide.offsetHeight / 2 ) - 20, minTop ) + 'px';
+ slide.style.top = Math.max( - ( slide.offsetHeight / 2 ) - 20, minTop ) + 'px';
}
}
}
+
}
/**