aboutsummaryrefslogtreecommitdiff
path: root/js/reveal.js
diff options
context:
space:
mode:
authorHakim El Hattab <hakim.elhattab@gmail.com>2013-01-30 23:59:37 -0500
committerHakim El Hattab <hakim.elhattab@gmail.com>2013-01-30 23:59:37 -0500
commit9660cdbd26524ea220bec5fa2edca6dec5935284 (patch)
treebf828d39f043a713963adf200bd89f4be570c467 /js/reveal.js
parent1ca8306e2adbc8f2a2e299db5ddebf3b421f3464 (diff)
downloadfreenode-live-2017-presentation-9660cdbd26524ea220bec5fa2edca6dec5935284.tar
freenode-live-2017-presentation-9660cdbd26524ea220bec5fa2edca6dec5935284.tar.gz
add min/max scale settings (#310)
Diffstat (limited to 'js/reveal.js')
-rw-r--r--js/reveal.js15
1 files changed, 12 insertions, 3 deletions
diff --git a/js/reveal.js b/js/reveal.js
index e3938f0..c42af27 100644
--- a/js/reveal.js
+++ b/js/reveal.js
@@ -19,11 +19,16 @@ var Reveal = (function(){
// The "normal" size of the presentation, aspect ratio will be preserved
// when the presentation is scaled to fit different resolutions
- width: 1024,
- height: 768,
+ width: 960,
+ height: 700,
+ // Factor of the display size that should remain empty around the content
margin: 0.1,
+ // Bounds for smallest/largest possible scale to apply to content
+ minScale: 0.2,
+ maxScale: 1.4,
+
// Display controls in the bottom right corner
controls: true,
@@ -588,6 +593,10 @@ var Reveal = (function(){
// Determine scale of content to fit within available space
var scale = Math.min( availableWidth / slideWidth, availableHeight / slideHeight );
+ // Respect max/min scale settings
+ scale = Math.max( scale, config.minScale );
+ scale = Math.min( scale, config.maxScale );
+
// Prefer applying scale via zoom since Chrome blurs scaled content
// with nested transforms
if( typeof dom.slides.style.zoom !== 'undefined' && !navigator.userAgent.match( /(iphone|ipod|android)/gi ) ) {
@@ -1123,7 +1132,7 @@ var Reveal = (function(){
var slideAutoSlide = slides[index].getAttribute( 'data-autoslide' );
if( slideAutoSlide ) {
autoSlide = parseInt( slideAutoSlide, 10 );
- }
+ }
else {
autoSlide = config.autoSlide;
}