aboutsummaryrefslogtreecommitdiff
path: root/js/reveal.js
diff options
context:
space:
mode:
authorhakimel <hakim.elhattab@gmail.com>2013-01-21 12:45:52 -0500
committerhakimel <hakim.elhattab@gmail.com>2013-01-21 12:45:52 -0500
commitd489ec2f9ddddb9e502c3cccbfe277f84c22963b (patch)
tree54357e26797c651077c84dab97caaabeb2e3cc48 /js/reveal.js
parente62b0f8795408e042a86f654ea4636ab95894476 (diff)
downloadfreenode-live-2017-presentation-d489ec2f9ddddb9e502c3cccbfe277f84c22963b.tar
freenode-live-2017-presentation-d489ec2f9ddddb9e502c3cccbfe277f84c22963b.tar.gz
add overviewshown and overviewhidden events (closes #298)
Diffstat (limited to 'js/reveal.js')
-rw-r--r--js/reveal.js22
1 files changed, 20 insertions, 2 deletions
diff --git a/js/reveal.js b/js/reveal.js
index 93b14f7..b3d1d7f 100644
--- a/js/reveal.js
+++ b/js/reveal.js
@@ -622,14 +622,16 @@ var Reveal = (function(){
// Only proceed if enabled in config
if( config.overview ) {
+ var wasActive = dom.wrapper.classList.contains( 'overview' );
+
dom.wrapper.classList.add( 'overview' );
dom.wrapper.classList.remove( 'exit-overview' );
clearTimeout( activateOverviewTimeout );
clearTimeout( deactivateOverviewTimeout );
- // Not the pretties solution, but need to let the overview
- // class apply first so that slides are measured accurately
+ // Not the pretties solution, but need to let the overview
+ // class apply first so that slides are measured accurately
// before we can position them
activateOverviewTimeout = setTimeout( function(){
@@ -681,6 +683,15 @@ var Reveal = (function(){
layout();
+ if( !wasActive ) {
+ // Notify observers of the overview showing
+ dispatchEvent( 'overviewshown', {
+ 'indexh': indexh,
+ 'indexv': indexv,
+ 'currentSlide': currentSlide
+ } );
+ }
+
}, 10 );
}
@@ -730,6 +741,13 @@ var Reveal = (function(){
slide( indexh, indexv );
+ // Notify observers of the overview hiding
+ dispatchEvent( 'overviewhidden', {
+ 'indexh': indexh,
+ 'indexv': indexv,
+ 'currentSlide': currentSlide
+ } );
+
}
}