add option for disabling overview mode (closes #145)

This commit is contained in:
Hakim El Hattab 2012-09-21 08:58:21 -04:00
parent 6779f4aecb
commit c904cef864
4 changed files with 107 additions and 53 deletions

View File

@ -70,6 +70,9 @@ Reveal.initialize({
// Enable keyboard shortcuts for navigation // Enable keyboard shortcuts for navigation
keyboard: true, keyboard: true,
// Enable the slide overview mode
overview: true,
// Loop the presentation // Loop the presentation
loop: false, loop: false,

View File

@ -333,5 +333,43 @@ function linkify( selector ) {
</script> </script>
<!-- Everything below this point is unrelated to the slideshow -->
<div class="share-reveal" style="position: absolute; bottom: 10px; left: 50%; margin-left: -160px">
<a href="http://twitter.com/share" class="twitter-share-button" data-text="reveal.js - an HTML presentation framework from @hakimel." data-url="http://lab.hakim.se/reveal-js" data-count="small" data-related="hakimel"></a>
<iframe id="facebook-button" src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fapp.hakim.se%2Freveal-js%2F&layout=button_count&show_faces=false&width=93&action=like&font=arial&colorscheme=light&height=21" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:85px; height:24px; position: relative; top: 4px;" allowTransparency="true"></iframe>
<script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script>
<script type="text/javascript">
/* <![CDATA[ */
(function() {
var s = document.createElement('script'), t = document.getElementsByTagName('script')[0];
s.type = 'text/javascript';
s.async = true;
s.src = 'http://api.flattr.com/js/0.6/load.js?mode=auto';
t.parentNode.insertBefore(s, t);
})();
/* ]]> */
</script>
<a class="FlattrButton" style="display:none;" rev="flattr;button:compact;" href="http://lab.hakim.se/reveal-js"></a>
<noscript><a href="http://flattr.com/thing/447435/Reveal-js" target="_blank">
<img src="http://api.flattr.com/button/flattr-badge-large.png" alt="Flattr this" title="Flattr this" border="0" /></a></noscript>
</div>
<a class="fork-reveal" href="https://github.com/hakimel/reveal.js"><img style="position: absolute; top: 0; right: 0; border: 0;" src="https://a248.e.akamai.net/camo.github.com/e6bef7a091f5f3138b8cd40bc3e114258dd68ddf/687474703a2f2f73332e616d617a6f6e6177732e636f6d2f6769746875622f726962626f6e732f666f726b6d655f72696768745f7265645f6161303030302e706e67" alt="Fork me on GitHub"></a>
<script>
var _gaq = [['_setAccount', 'UA-15240703-1'], ['_trackPageview']];
(function(d, t) {
var g = d.createElement(t),
s = d.getElementsByTagName(t)[0];
g.async = true;
g.src = ('https:' == location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
s.parentNode.insertBefore(g, s);
})(document, 'script');
</script>
</body> </body>
</html> </html>

View File

@ -26,6 +26,9 @@ var Reveal = (function(){
// Enable keyboard shortcuts for navigation // Enable keyboard shortcuts for navigation
keyboard: true, keyboard: true,
// Enable the slide overview mode
overview: true,
// Loop the presentation // Loop the presentation
loop: false, loop: false,
@ -532,6 +535,8 @@ var Reveal = (function(){
*/ */
function activateOverview() { function activateOverview() {
if( config.overview ) {
dom.wrapper.classList.add( 'overview' ); dom.wrapper.classList.add( 'overview' );
var horizontalSlides = Array.prototype.slice.call( document.querySelectorAll( HORIZONTAL_SLIDES_SELECTOR ) ); var horizontalSlides = Array.prototype.slice.call( document.querySelectorAll( HORIZONTAL_SLIDES_SELECTOR ) );
@ -573,6 +578,9 @@ var Reveal = (function(){
} }
} }
}
} }
/** /**
@ -580,6 +588,9 @@ var Reveal = (function(){
* active slide. * active slide.
*/ */
function deactivateOverview() { function deactivateOverview() {
if( config.overview ) {
dom.wrapper.classList.remove( 'overview' ); dom.wrapper.classList.remove( 'overview' );
var slides = Array.prototype.slice.call( document.querySelectorAll( '.reveal .slides section' ) ); var slides = Array.prototype.slice.call( document.querySelectorAll( '.reveal .slides section' ) );
@ -598,6 +609,8 @@ var Reveal = (function(){
} }
slide(); slide();
}
} }
/** /**

12
js/reveal.min.js vendored

File diff suppressed because one or more lines are too long