|
@@ -1,5 +1,5 @@
|
|
|
|
|
|
- * reveal.js 1.5 r1
|
|
|
+ * reveal.js 1.5 r2
|
|
|
* http:
|
|
|
* MIT licensed
|
|
|
*
|
|
@@ -12,10 +12,6 @@ var Reveal = (function(){
|
|
|
|
|
|
IS_TOUCH_DEVICE = !!( 'ontouchstart' in window ),
|
|
|
|
|
|
-
|
|
|
- indexh = 0,
|
|
|
- indexv = 0,
|
|
|
-
|
|
|
|
|
|
config = {
|
|
|
|
|
@@ -50,6 +46,14 @@ var Reveal = (function(){
|
|
|
transition: 'default'
|
|
|
},
|
|
|
|
|
|
+
|
|
|
+ indexh = 0,
|
|
|
+ indexv = 0,
|
|
|
+
|
|
|
+
|
|
|
+ previousSlide,
|
|
|
+ currentSlide,
|
|
|
+
|
|
|
|
|
|
|
|
|
|
|
@@ -650,6 +654,9 @@ var Reveal = (function(){
|
|
|
* set indices.
|
|
|
*/
|
|
|
function slide( h, v ) {
|
|
|
+
|
|
|
+ previousSlide = currentSlide;
|
|
|
+
|
|
|
|
|
|
var stateBefore = state.concat();
|
|
|
|
|
@@ -700,31 +707,30 @@ var Reveal = (function(){
|
|
|
clearTimeout( writeURLTimeout );
|
|
|
writeURLTimeout = setTimeout( writeURL, 1500 );
|
|
|
|
|
|
-
|
|
|
- if( indexh !== indexhBefore || indexv !== indexvBefore ) {
|
|
|
-
|
|
|
- var horizontalSlides = document.querySelectorAll( HORIZONTAL_SLIDES_SELECTOR );
|
|
|
+
|
|
|
+ var horizontalSlides = document.querySelectorAll( HORIZONTAL_SLIDES_SELECTOR );
|
|
|
|
|
|
-
|
|
|
- var previousHorizontalSlide = horizontalSlides[ indexhBefore ],
|
|
|
- currentHorizontalSlide = horizontalSlides[ indexh ];
|
|
|
+
|
|
|
+
|
|
|
+ var currentHorizontalSlide = horizontalSlides[ indexh ],
|
|
|
+ currentVerticalSlides = currentHorizontalSlide.querySelectorAll( 'section' );
|
|
|
|
|
|
-
|
|
|
- var previousVerticalSlides = previousHorizontalSlide.querySelectorAll( 'section' );
|
|
|
- currentVerticalSlides = currentHorizontalSlide.querySelectorAll( 'section' );
|
|
|
+
|
|
|
+ currentSlide = currentVerticalSlides[ indexv ] || currentHorizontalSlide;
|
|
|
|
|
|
-
|
|
|
+
|
|
|
+ if( indexh !== indexhBefore || indexv !== indexvBefore ) {
|
|
|
dispatchEvent( 'slidechanged', {
|
|
|
-
|
|
|
'indexh': indexh,
|
|
|
'indexv': indexv,
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- 'previousSlide': previousVerticalSlides[ indexvBefore ] || previousHorizontalSlide,
|
|
|
- 'currentSlide': currentVerticalSlides[ indexv ] || currentHorizontalSlide
|
|
|
+ 'previousSlide': previousSlide,
|
|
|
+ 'currentSlide': currentSlide
|
|
|
} );
|
|
|
}
|
|
|
+ else {
|
|
|
+
|
|
|
+ previousSlide = null;
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
|
|
@@ -980,9 +986,28 @@ var Reveal = (function(){
|
|
|
navigateNext: navigateNext,
|
|
|
toggleOverview: toggleOverview,
|
|
|
|
|
|
+
|
|
|
addEventListeners: addEventListeners,
|
|
|
removeEventListeners: removeEventListeners,
|
|
|
|
|
|
+
|
|
|
+ getIndices: function() {
|
|
|
+ return {
|
|
|
+ h: indexh,
|
|
|
+ v: indexv
|
|
|
+ };
|
|
|
+ },
|
|
|
+
|
|
|
+
|
|
|
+ getPreviousSlide: function() {
|
|
|
+ return previousSlide
|
|
|
+ },
|
|
|
+
|
|
|
+
|
|
|
+ getCurrentSlide: function() {
|
|
|
+ return currentSlide
|
|
|
+ },
|
|
|
+
|
|
|
|
|
|
addEventListener: function( type, listener, useCapture ) {
|
|
|
( dom.wrapper || document.querySelector( '.reveal' ) ).addEventListener( type, listener, useCapture );
|