Skip to content
Snippets Groups Projects
Commit 59c9b3c5 authored by Hakim El Hattab's avatar Hakim El Hattab
Browse files

fragments now work in vertical slides (fixes #4)

parent e6f444a3
No related branches found
No related tags found
No related merge requests found
...@@ -364,7 +364,7 @@ a:not(.image) { ...@@ -364,7 +364,7 @@ a:not(.image) {
border-radius: 2px; border-radius: 2px;
} }
img { section img {
margin: 30px 0 0 0; margin: 30px 0 0 0;
background: rgba(255,255,255,0.12); background: rgba(255,255,255,0.12);
border: 4px solid #eee; border: 4px solid #eee;
......
...@@ -358,13 +358,20 @@ var Reveal = (function(){ ...@@ -358,13 +358,20 @@ var Reveal = (function(){
* @return {Boolean} true if there was a next fragment, * @return {Boolean} true if there was a next fragment,
* false otherwise * false otherwise
*/ */
function nextFragment() { function nextFragment() {
var fragments = document.querySelectorAll( '.present .fragment:not(.visible)' ); if( document.querySelector( VERTICAL_SLIDES_SELECTOR + '.present' ) ) {
var verticalFragments = document.querySelectorAll( VERTICAL_SLIDES_SELECTOR + '.present .fragment:not(.visible)' );
if( fragments.length ) { if( verticalFragments.length ) {
fragments[0].classList.add( 'visible' ); verticalFragments[0].classList.add( 'visible' );
return true;
return true; }
}
else {
var horizontalFragments = document.querySelectorAll( HORIZONTAL_SLIDES_SELECTOR + '.present .fragment:not(.visible)' );
if( horizontalFragments.length ) {
horizontalFragments[0].classList.add( 'visible' );
return true;
}
} }
return false; return false;
...@@ -377,14 +384,21 @@ var Reveal = (function(){ ...@@ -377,14 +384,21 @@ var Reveal = (function(){
* false otherwise * false otherwise
*/ */
function previousFragment() { function previousFragment() {
var fragments = document.querySelectorAll( '.present .fragment.visible' ); if( document.querySelector( VERTICAL_SLIDES_SELECTOR + '.present' ) ) {
var verticalFragments = document.querySelectorAll( VERTICAL_SLIDES_SELECTOR + '.present .fragment.visible' );
if( fragments.length ) { if( verticalFragments.length ) {
fragments[ fragments.length - 1 ].classList.remove( 'visible' ); verticalFragments[ verticalFragments.length - 1 ].classList.remove( 'visible' );
return true;
return true; }
} }
else {
var horizontalFragments = document.querySelectorAll( HORIZONTAL_SLIDES_SELECTOR + '.present .fragment.visible' );
if( horizontalFragments.length ) {
horizontalFragments[ horizontalFragments.length - 1 ].classList.remove( 'visible' );
return true;
}
}
return false; return false;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment