From 1219564e0560702b1d0d4df9983bae0fbac7fde4 Mon Sep 17 00:00:00 2001 From: Nigel Stanger Date: Thu, 2 May 2013 12:02:46 +1200 Subject: [PATCH 1/2] Added clear:left to notes DIV Resolves an issue where the first label (e.g., first bullet or first number) of a list would wrap to the right side of the window and be hidden under the clock element. --- plugin/notes/notes.html | 1 + 1 file changed, 1 insertion(+) diff --git a/plugin/notes/notes.html b/plugin/notes/notes.html index e14c6ac..5726fbd 100644 --- a/plugin/notes/notes.html +++ b/plugin/notes/notes.html @@ -14,6 +14,7 @@ font-size: 24px; width: 640px; margin-top: 5px; + clear: left; } #wrap-current-slide { From 76fce3b4d9f524e9a6534bb19745894e1c743849 Mon Sep 17 00:00:00 2001 From: Nigel Stanger Date: Thu, 2 May 2013 12:26:23 +1200 Subject: [PATCH 2/2] Support for multiple elements with same data-fragment-index When multiple elements are specified with the same data-fragment-index, they are all shown or hidden at once. --- js/reveal.js | 36 ++++++++++++++++++++++++++---------- 1 file changed, 26 insertions(+), 10 deletions(-) diff --git a/js/reveal.js b/js/reveal.js index a4a71db..d27b625 100644 --- a/js/reveal.js +++ b/js/reveal.js @@ -1629,11 +1629,19 @@ var Reveal = (function(){ var fragments = sortFragments( currentSlide.querySelectorAll( '.fragment:not(.visible)' ) ); if( fragments.length ) { - fragments[0].classList.add( 'visible' ); - - // Notify subscribers of the change - dispatchEvent( 'fragmentshown', { fragment: fragments[0] } ); - + // There may be multiple fragments with the same index. We want to display all of them. + var nextFragmentIndex = fragments[0].getAttribute( 'data-fragment-index' ); + + toArray( fragments ).forEach( function( thisFragment ) { + var f = thisFragment.getAttribute( 'data-fragment-index' ); + if( f === nextFragmentIndex ) { + thisFragment.classList.add( 'visible' ); + + // Notify subscribers of the change + dispatchEvent( 'fragmentshown', { fragment: thisFragment } ); + } + } ); + updateControls(); return true; } @@ -1655,10 +1663,18 @@ var Reveal = (function(){ var fragments = sortFragments( currentSlide.querySelectorAll( '.fragment.visible' ) ); if( fragments.length ) { - fragments[ fragments.length - 1 ].classList.remove( 'visible' ); - - // Notify subscribers of the change - dispatchEvent( 'fragmenthidden', { fragment: fragments[ fragments.length - 1 ] } ); + // There may be multiple fragments with the same index. We want to display all of them. + var prevFragmentIndex = fragments[0].getAttribute( 'data-fragment-index' ); + + toArray( fragments ).forEach( function( thisFragment ) { + var f = thisFragment.getAttribute( 'data-fragment-index' ); + if( f === prevFragmentIndex ) { + thisFragment.classList.remove( 'visible' ); + + // Notify subscribers of the change + dispatchEvent( 'fragmenthidden', { fragment: thisFragment } ); + } + } ); updateControls(); return true; @@ -2226,4 +2242,4 @@ var Reveal = (function(){ } }; -})(); \ No newline at end of file +})();