diff options
author | Hakim El Hattab | 2013-02-24 00:52:54 -0500 |
---|---|---|
committer | Hakim El Hattab | 2013-02-24 00:52:54 -0500 |
commit | 40759435e48891f32e72b8da8c7df332976eef48 (patch) | |
tree | 164f6023761da92a5fab711b24afdd5070773909 /js/reveal.js | |
parent | f795cb02690dd9f3a6ea64f880797840dc675c89 (diff) |
prevent overview click events after calling Reveal.removeEventListeners
Diffstat (limited to 'js/reveal.js')
-rw-r--r-- | js/reveal.js | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/js/reveal.js b/js/reveal.js index a559090..5c658ad 100644 --- a/js/reveal.js +++ b/js/reveal.js @@ -129,6 +129,9 @@ var Reveal = (function(){ // A delay used to deactivate the overview mode deactivateOverviewTimeout = 0, + // Flags if the interaction event listeners are bound + eventsAreBound = false, + // Holds information about the currently ongoing touch input touch = { startX: 0, @@ -390,6 +393,8 @@ var Reveal = (function(){ */ function addEventListeners() { + eventsAreBound = true; + window.addEventListener( 'hashchange', onWindowHashChange, false ); window.addEventListener( 'resize', onWindowResize, false ); @@ -424,6 +429,8 @@ var Reveal = (function(){ */ function removeEventListeners() { + eventsAreBound = false; + document.removeEventListener( 'keydown', onDocumentKeyDown, false ); window.removeEventListener( 'hashchange', onWindowHashChange, false ); window.removeEventListener( 'resize', onWindowResize, false ); @@ -1801,7 +1808,7 @@ var Reveal = (function(){ // TODO There's a bug here where the event listeners are not // removed after deactivating the overview. - if( isOverview() ) { + if( eventsAreBound && isOverview() ) { event.preventDefault(); deactivateOverview(); |