diff options
Diffstat (limited to 'js/reveal.js')
-rw-r--r-- | js/reveal.js | 88 |
1 files changed, 22 insertions, 66 deletions
diff --git a/js/reveal.js b/js/reveal.js index 033fe31..107b67b 100644 --- a/js/reveal.js +++ b/js/reveal.js @@ -67,9 +67,6 @@ var Reveal = (function(){ // Enable slide navigation via mouse wheel mouseWheel: false, - // Apply a 3D roll to links on hover - rollingLinks: true, - // Opens links in an iframe preview overlay previewLinks: false, @@ -83,7 +80,7 @@ var Reveal = (function(){ transitionSpeed: 'default', // default/fast/slow // Transition style for full page slide backgrounds - backgroundTransition: 'default', // default/linear + backgroundTransition: 'default', // default/linear/none // Script dependencies to load dependencies: [] @@ -93,8 +90,8 @@ var Reveal = (function(){ autoSlide = 0, // The horizontal and vertical index of the currently active slide - indexh = 0, - indexv = 0, + indexh, + indexv, // The previous and current slide HTML elements previousSlide, @@ -478,14 +475,6 @@ var Reveal = (function(){ document.removeEventListener( 'mousewheel', onDocumentMouseScroll, false ); } - // Rolling 3D links - if( config.rollingLinks ) { - enableRollingLinks(); - } - else { - disableRollingLinks(); - } - // Iframe link previews if( config.previewLinks ) { enablePreviewLinks(); @@ -709,50 +698,6 @@ var Reveal = (function(){ } /** - * Wrap all links in 3D goodness. - */ - function enableRollingLinks() { - - if( supports3DTransforms && !( 'msPerspective' in document.body.style ) ) { - var anchors = document.querySelectorAll( SLIDES_SELECTOR + ' a:not(.image)' ); - - for( var i = 0, len = anchors.length; i < len; i++ ) { - var anchor = anchors[i]; - - if( anchor.textContent && !anchor.querySelector( '*' ) && ( !anchor.className || !anchor.classList.contains( anchor, 'roll' ) ) ) { - var span = document.createElement('span'); - span.setAttribute('data-title', anchor.text); - span.innerHTML = anchor.innerHTML; - - anchor.classList.add( 'roll' ); - anchor.innerHTML = ''; - anchor.appendChild(span); - } - } - } - - } - - /** - * Unwrap all 3D links. - */ - function disableRollingLinks() { - - var anchors = document.querySelectorAll( SLIDES_SELECTOR + ' a.roll' ); - - for( var i = 0, len = anchors.length; i < len; i++ ) { - var anchor = anchors[i]; - var span = anchor.querySelector( 'span' ); - - if( span ) { - anchor.classList.remove( 'roll' ); - anchor.innerHTML = span.innerHTML; - } - } - - } - - /** * Bind preview frame links. */ function enablePreviewLinks( selector ) { @@ -1338,10 +1283,6 @@ var Reveal = (function(){ activateOverview(); } - // Update the URL hash after a delay since updating it mid-transition - // is likely to cause visual lag - writeURL( 1500 ); - // Find the current horizontal slide and any possible vertical slides // within it var currentHorizontalSlide = horizontalSlides[ indexh ], @@ -1413,6 +1354,9 @@ var Reveal = (function(){ updateProgress(); updateBackground(); + // Update the URL hash + writeURL(); + } /** @@ -1507,6 +1451,13 @@ var Reveal = (function(){ else if( i > index ) { // Any element subsequent to index is given the 'future' class element.classList.add( reverse ? 'past' : 'future' ); + + var fragments = toArray( element.querySelectorAll( '.fragment.visible' ) ); + + // No fragments in future slides should be visible ahead of time + while( fragments.length ) { + fragments.pop().classList.remove( 'visible' ); + } } // If this element contains vertical slides @@ -1526,7 +1477,7 @@ var Reveal = (function(){ state = state.concat( slideState.split( ' ' ) ); } - // If this slide has a data-autoslide attribtue associated use this as + // If this slide has a data-autoslide attribute associated use this as // autoSlide value otherwise use the global configured time var slideAutoSlide = slides[index].getAttribute( 'data-autoslide' ); if( slideAutoSlide ) { @@ -1536,6 +1487,8 @@ var Reveal = (function(){ autoSlide = config.autoSlide; } + cueAutoSlide(); + } else { // Since there are no slides we can't be anywhere beyond the @@ -1811,7 +1764,9 @@ var Reveal = (function(){ var h = parseInt( bits[0], 10 ) || 0, v = parseInt( bits[1], 10 ) || 0; - slide( h, v ); + if( h !== indexh || v !== indexv ) { + slide( h, v ); + } } } @@ -2119,7 +2074,7 @@ var Reveal = (function(){ var value = config.keyboard[ key ]; - // Calback function + // Callback function if( typeof value === 'function' ) { value.apply( null, [ event ] ); } @@ -2178,7 +2133,8 @@ var Reveal = (function(){ if( triggered ) { event.preventDefault(); } - else if ( event.keyCode === 27 && supports3DTransforms ) { + // ESC or O key + else if ( ( event.keyCode === 27 || event.keyCode === 79 ) && supports3DTransforms ) { toggleOverview(); event.preventDefault(); |