disable transition into and out of overview mode #829

This commit is contained in:
Hakim El Hattab 2014-03-25 17:46:10 +01:00
parent baa6fa45de
commit a9c2d4d663
4 changed files with 46 additions and 61 deletions

View File

@ -1103,9 +1103,7 @@ body {
.reveal.fade.overview .slides section, .reveal.fade.overview .slides section,
.reveal.fade.overview .slides>section>section, .reveal.fade.overview .slides>section>section {
.reveal.fade.overview-deactivating .slides section,
.reveal.fade.overview-deactivating .slides>section>section {
-webkit-transition: none; -webkit-transition: none;
-moz-transition: none; -moz-transition: none;
transition: none; transition: none;
@ -1155,6 +1153,12 @@ body {
cursor: pointer; cursor: pointer;
background: rgba(0,0,0,0.1); background: rgba(0,0,0,0.1);
} }
.reveal.overview .slides section,
.reveal.overview-deactivating .slides section {
-webkit-transition: none !important;
-moz-transition: none !important;
transition: none !important;
}
.reveal.overview .slides section .fragment { .reveal.overview .slides section .fragment {
opacity: 1; opacity: 1;
} }

2
css/reveal.min.css vendored

File diff suppressed because one or more lines are too long

View File

@ -151,12 +151,6 @@ var Reveal = (function(){
// Delays updates to the URL due to a Chrome thumbnailer bug // Delays updates to the URL due to a Chrome thumbnailer bug
writeURLTimeout = 0, writeURLTimeout = 0,
// A delay used to activate the overview mode
activateOverviewTimeout = 0,
// A delay used to deactivate the overview mode
deactivateOverviewTimeout = 0,
// Flags if the interaction event listeners are bound // Flags if the interaction event listeners are bound
eventsAreBound = false, eventsAreBound = false,
@ -1238,67 +1232,57 @@ var Reveal = (function(){
dom.wrapper.classList.add( 'overview' ); dom.wrapper.classList.add( 'overview' );
dom.wrapper.classList.remove( 'overview-deactivating' ); dom.wrapper.classList.remove( 'overview-deactivating' );
clearTimeout( activateOverviewTimeout ); var horizontalSlides = document.querySelectorAll( HORIZONTAL_SLIDES_SELECTOR );
clearTimeout( deactivateOverviewTimeout );
// Not the pretties solution, but need to let the overview for( var i = 0, len1 = horizontalSlides.length; i < len1; i++ ) {
// class apply first so that slides are measured accurately var hslide = horizontalSlides[i],
// before we can position them hoffset = config.rtl ? -105 : 105;
activateOverviewTimeout = setTimeout( function() {
var horizontalSlides = document.querySelectorAll( HORIZONTAL_SLIDES_SELECTOR ); hslide.setAttribute( 'data-index-h', i );
for( var i = 0, len1 = horizontalSlides.length; i < len1; i++ ) { // Apply CSS transform
var hslide = horizontalSlides[i], transformElement( hslide, 'translateZ(-'+ depth +'px) translate(' + ( ( i - indexh ) * hoffset ) + '%, 0%)' );
hoffset = config.rtl ? -105 : 105;
hslide.setAttribute( 'data-index-h', i ); if( hslide.classList.contains( 'stack' ) ) {
// Apply CSS transform var verticalSlides = hslide.querySelectorAll( 'section' );
transformElement( hslide, 'translateZ(-'+ depth +'px) translate(' + ( ( i - indexh ) * hoffset ) + '%, 0%)' );
if( hslide.classList.contains( 'stack' ) ) { for( var j = 0, len2 = verticalSlides.length; j < len2; j++ ) {
var verticalIndex = i === indexh ? indexv : getPreviousVerticalIndex( hslide );
var verticalSlides = hslide.querySelectorAll( 'section' ); var vslide = verticalSlides[j];
for( var j = 0, len2 = verticalSlides.length; j < len2; j++ ) { vslide.setAttribute( 'data-index-h', i );
var verticalIndex = i === indexh ? indexv : getPreviousVerticalIndex( hslide ); vslide.setAttribute( 'data-index-v', j );
var vslide = verticalSlides[j]; // Apply CSS transform
transformElement( vslide, 'translate(0%, ' + ( ( j - verticalIndex ) * 105 ) + '%)' );
vslide.setAttribute( 'data-index-h', i );
vslide.setAttribute( 'data-index-v', j );
// Apply CSS transform
transformElement( vslide, 'translate(0%, ' + ( ( j - verticalIndex ) * 105 ) + '%)' );
// Navigate to this slide on click
vslide.addEventListener( 'click', onOverviewSlideClicked, true );
}
}
else {
// Navigate to this slide on click // Navigate to this slide on click
hslide.addEventListener( 'click', onOverviewSlideClicked, true ); vslide.addEventListener( 'click', onOverviewSlideClicked, true );
} }
} }
else {
updateSlidesVisibility(); // Navigate to this slide on click
hslide.addEventListener( 'click', onOverviewSlideClicked, true );
layout();
if( !wasActive ) {
// Notify observers of the overview showing
dispatchEvent( 'overviewshown', {
'indexh': indexh,
'indexv': indexv,
'currentSlide': currentSlide
} );
} }
}
}, 10 ); updateSlidesVisibility();
layout();
if( !wasActive ) {
// Notify observers of the overview showing
dispatchEvent( 'overviewshown', {
'indexh': indexh,
'indexv': indexv,
'currentSlide': currentSlide
} );
}
} }
@ -1313,9 +1297,6 @@ var Reveal = (function(){
// Only proceed if enabled in config // Only proceed if enabled in config
if( config.overview ) { if( config.overview ) {
clearTimeout( activateOverviewTimeout );
clearTimeout( deactivateOverviewTimeout );
dom.wrapper.classList.remove( 'overview' ); dom.wrapper.classList.remove( 'overview' );
// Temporarily add a class so that transitions can do different things // Temporarily add a class so that transitions can do different things
@ -1323,7 +1304,7 @@ var Reveal = (function(){
// moving from slide to slide // moving from slide to slide
dom.wrapper.classList.add( 'overview-deactivating' ); dom.wrapper.classList.add( 'overview-deactivating' );
deactivateOverviewTimeout = setTimeout( function () { setTimeout( function () {
dom.wrapper.classList.remove( 'overview-deactivating' ); dom.wrapper.classList.remove( 'overview-deactivating' );
}, 1 ); }, 1 );

6
js/reveal.min.js vendored

File diff suppressed because one or more lines are too long