|
@@ -1,5 +1,5 @@
|
|
|
|
|
|
- * reveal.js 2.2 r39
|
|
|
+ * reveal.js 2.2 r40
|
|
|
* http:
|
|
|
* MIT licensed
|
|
|
*
|
|
@@ -9,7 +9,8 @@ var Reveal = (function(){
|
|
|
|
|
|
'use strict';
|
|
|
|
|
|
- var HORIZONTAL_SLIDES_SELECTOR = '.reveal .slides>section',
|
|
|
+ var SLIDES_SELECTOR = '.reveal .slides section',
|
|
|
+ HORIZONTAL_SLIDES_SELECTOR = '.reveal .slides>section',
|
|
|
VERTICAL_SLIDES_SELECTOR = '.reveal .slides>section.present>section',
|
|
|
|
|
|
|
|
@@ -469,7 +470,7 @@ var Reveal = (function(){
|
|
|
*/
|
|
|
function linkify() {
|
|
|
if( supports3DTransforms && !( 'msPerspective' in document.body.style ) ) {
|
|
|
- var nodes = document.querySelectorAll( '.reveal .slides section a:not(.image)' );
|
|
|
+ var nodes = document.querySelectorAll( SLIDES_SELECTOR + ' a:not(.image)' );
|
|
|
|
|
|
for( var i = 0, len = nodes.length; i < len; i++ ) {
|
|
|
var node = nodes[i];
|
|
@@ -491,7 +492,7 @@ var Reveal = (function(){
|
|
|
if( config.center ) {
|
|
|
|
|
|
|
|
|
- var slides = Array.prototype.slice.call( document.querySelectorAll( '.reveal .slides section' ) );
|
|
|
+ var slides = toArray( document.querySelectorAll( SLIDES_SELECTOR ) );
|
|
|
|
|
|
|
|
|
var minTop = -dom.wrapper.offsetHeight / 2;
|
|
@@ -583,7 +584,7 @@ var Reveal = (function(){
|
|
|
dom.wrapper.classList.remove( 'overview' );
|
|
|
|
|
|
|
|
|
- var slides = Array.prototype.slice.call( document.querySelectorAll( '.reveal .slides section' ) );
|
|
|
+ var slides = toArray( document.querySelectorAll( SLIDES_SELECTOR ) );
|
|
|
|
|
|
for( var i = 0, len = slides.length; i < len; i++ ) {
|
|
|
var element = slides[i];
|
|
@@ -732,18 +733,11 @@ var Reveal = (function(){
|
|
|
document.documentElement.classList.remove( stateBefore.pop() );
|
|
|
}
|
|
|
|
|
|
-
|
|
|
- if( config.progress && dom.progress ) {
|
|
|
- dom.progressbar.style.width = ( indexh / ( document.querySelectorAll( HORIZONTAL_SLIDES_SELECTOR ).length - 1 ) ) * window.innerWidth + 'px';
|
|
|
- }
|
|
|
-
|
|
|
|
|
|
if( isOverviewActive() ) {
|
|
|
activateOverview();
|
|
|
}
|
|
|
|
|
|
- updateControls();
|
|
|
-
|
|
|
|
|
|
|
|
|
clearTimeout( writeURLTimeout );
|
|
@@ -780,6 +774,9 @@ var Reveal = (function(){
|
|
|
if( previousSlide ) {
|
|
|
previousSlide.classList.remove( 'present' );
|
|
|
}
|
|
|
+
|
|
|
+ updateControls();
|
|
|
+ updateProgress();
|
|
|
}
|
|
|
|
|
|
|
|
@@ -798,7 +795,7 @@ var Reveal = (function(){
|
|
|
function updateSlides( selector, index ) {
|
|
|
|
|
|
|
|
|
- var slides = Array.prototype.slice.call( document.querySelectorAll( selector ) ),
|
|
|
+ var slides = toArray( document.querySelectorAll( selector ) ),
|
|
|
slidesLength = slides.length;
|
|
|
|
|
|
if( slidesLength ) {
|
|
@@ -878,7 +875,48 @@ var Reveal = (function(){
|
|
|
}
|
|
|
|
|
|
|
|
|
- * Updates the state and link pointers of the controls.
|
|
|
+ * Updates the progress bar to reflect the current slide.
|
|
|
+ */
|
|
|
+ function updateProgress() {
|
|
|
+
|
|
|
+ if( config.progress && dom.progress ) {
|
|
|
+
|
|
|
+ var horizontalSlides = toArray( document.querySelectorAll( HORIZONTAL_SLIDES_SELECTOR ) );
|
|
|
+
|
|
|
+
|
|
|
+ var totalCount = document.querySelectorAll( SLIDES_SELECTOR + ':not(.stack)' ).length;
|
|
|
+ var pastCount = 0;
|
|
|
+
|
|
|
+
|
|
|
+ mainLoop: for( var i = 0; i < horizontalSlides.length; i++ ) {
|
|
|
+
|
|
|
+ var horizontalSlide = horizontalSlides[i];
|
|
|
+ var verticalSlides = toArray( horizontalSlide.querySelectorAll( 'section' ) );
|
|
|
+
|
|
|
+ for( var j = 0; j < verticalSlides.length; j++ ) {
|
|
|
+
|
|
|
+
|
|
|
+ if( verticalSlides[j].classList.contains( 'present' ) ) break mainLoop;
|
|
|
+
|
|
|
+ pastCount++
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ if( horizontalSlide.classList.contains( 'present' ) ) break;
|
|
|
+
|
|
|
+
|
|
|
+ if( horizontalSlide.classList.contains( 'stack' ) === false ) pastCount++;
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ dom.progressbar.style.width = ( pastCount / ( totalCount - 1 ) ) * window.innerWidth + 'px';
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ * Updates the state of all control/navigation arrows.
|
|
|
*/
|
|
|
function updateControls() {
|
|
|
if ( config.controls && dom.controls ) {
|
|
@@ -1002,14 +1040,14 @@ var Reveal = (function(){
|
|
|
var slideh = isVertical ? slide.parentNode : slide;
|
|
|
|
|
|
|
|
|
- var horizontalSlides = Array.prototype.slice.call( document.querySelectorAll( HORIZONTAL_SLIDES_SELECTOR ) );
|
|
|
+ var horizontalSlides = toArray( document.querySelectorAll( HORIZONTAL_SLIDES_SELECTOR ) );
|
|
|
|
|
|
|
|
|
h = Math.max( horizontalSlides.indexOf( slideh ), 0 );
|
|
|
|
|
|
|
|
|
if( isVertical ) {
|
|
|
- v = Math.max( Array.prototype.slice.call( slide.parentNode.children ).indexOf( slide ), 0 );
|
|
|
+ v = Math.max( toArray( slide.parentNode.children ).indexOf( slide ), 0 );
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -1356,7 +1394,7 @@ var Reveal = (function(){
|
|
|
* ( clickX / presentationWidth ) * numberOfSlides
|
|
|
*/
|
|
|
function onProgressClick( event ) {
|
|
|
- var slidesTotal = Array.prototype.slice.call( document.querySelectorAll( HORIZONTAL_SLIDES_SELECTOR ) ).length;
|
|
|
+ var slidesTotal = toArray( document.querySelectorAll( HORIZONTAL_SLIDES_SELECTOR ) ).length;
|
|
|
var slideIndex = Math.floor( ( event.clientX / dom.wrapper.offsetWidth ) * slidesTotal );
|
|
|
|
|
|
slide( slideIndex );
|