updated to v2.3, initial implementation of uniformly scaled presentations (#310)

This commit is contained in:
Hakim El Hattab
2013-01-27 23:27:14 -05:00
parent 784fa9d2e3
commit d1c74523a4
6 changed files with 25 additions and 22 deletions

View File

@ -3,7 +3,7 @@
* http://lab.hakim.se/reveal-js
* MIT licensed
*
* Copyright (C) 2011-2012 Hakim El Hattab, http://hakim.se
* Copyright (C) 2011-2013 Hakim El Hattab, http://hakim.se
*/
var Reveal = (function(){
@ -16,6 +16,11 @@ var Reveal = (function(){
// Configurations defaults, can be overridden at initialization time
config = {
width: 1024,
height: 768,
padding: 0.1,
// Display controls in the bottom right corner
controls: true,
@ -547,6 +552,17 @@ var Reveal = (function(){
*/
function layout() {
dom.slides.style.width = config.width + 'px';
dom.slides.style.height = config.height + 'px';
var availableWidth = window.innerWidth - ( window.innerWidth * config.padding * 2 ),
availableHeight = window.innerHeight - ( window.innerHeight * config.padding * 2 );
var scale = Math.min( availableWidth / config.width, availableHeight / config.height );
// dom.slides.style.WebkitTransform = 'translate(-50%, -50%) scale('+ scale +') translate(50%, 50%)';
dom.slides.style.zoom = scale;
if( config.center ) {
// Select all slides, vertical and horizontal

4
js/reveal.min.js vendored

File diff suppressed because one or more lines are too long