diff options
author | Hakim El Hattab <hakim.elhattab@gmail.com> | 2014-04-22 14:06:58 +0200 |
---|---|---|
committer | Hakim El Hattab <hakim.elhattab@gmail.com> | 2014-04-22 14:06:58 +0200 |
commit | ce05138f9a9065526ee584d2f59e48952910522f (patch) | |
tree | 42b6435207eb0f0fbefac5d2afe4de4ea6b5c79a /js/reveal.js | |
parent | 9b2851376dee7a29e6142c011b3af80d6d917a87 (diff) | |
download | fosdem-2018-presentation-ce05138f9a9065526ee584d2f59e48952910522f.tar fosdem-2018-presentation-ce05138f9a9065526ee584d2f59e48952910522f.tar.gz |
dont toggle paused/overview modes needlessly when setting state
Diffstat (limited to 'js/reveal.js')
-rw-r--r-- | js/reveal.js | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/js/reveal.js b/js/reveal.js index cba8121..e133887 100644 --- a/js/reveal.js +++ b/js/reveal.js @@ -968,8 +968,6 @@ var Reveal = (function(){ */ function dispatchEvent( type, args ) { - console.log('event', type); - var event = document.createEvent( 'HTMLEvents', 1, 2 ); event.initEvent( type, true, true ); extend( event, args ); @@ -2498,8 +2496,17 @@ var Reveal = (function(){ if( typeof state === 'object' ) { slide( deserialize( state.indexh ), deserialize( state.indexv ), deserialize( state.indexf ) ); - togglePause( deserialize( state.paused ) ); - toggleOverview( deserialize( state.overview ) ); + + var pausedFlag = deserialize( state.paused ), + overviewFlag = deserialize( state.overview ); + + if( typeof pausedFlag === 'boolean' && pausedFlag !== isPaused() ) { + togglePause( pausedFlag ); + } + + if( typeof overviewFlag === 'boolean' && overviewFlag !== isOverview() ) { + toggleOverview( overviewFlag ); + } } } |