From 03385d7245f8c0428b5f8d8578022fb3a60fdd12 Mon Sep 17 00:00:00 2001 From: Hakim El Hattab Date: Fri, 26 Jul 2013 09:48:21 -0400 Subject: simplify client side notes plugin --- plugin/notes/notes.html | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) (limited to 'plugin/notes/notes.html') diff --git a/plugin/notes/notes.html b/plugin/notes/notes.html index 8af43fb..9151663 100644 --- a/plugin/notes/notes.html +++ b/plugin/notes/notes.html @@ -173,6 +173,7 @@ window.addEventListener( 'message', function( event ) { var data = JSON.parse( event.data ); + // No need for updating the notes in case of fragment changes if ( data.notes !== undefined) { if( data.markdown ) { @@ -183,18 +184,9 @@ } } - // Showing and hiding fragments - if( data.fragment === 'next' ) { - currentSlide.contentWindow.Reveal.nextFragment(); - } - else if( data.fragment === 'prev' ) { - currentSlide.contentWindow.Reveal.prevFragment(); - } - else { - // Update the note slides - currentSlide.contentWindow.Reveal.slide( data.indexh, data.indexv ); - nextSlide.contentWindow.Reveal.slide( data.nextindexh, data.nextindexv ); - } + // Update the note slides + currentSlide.contentWindow.Reveal.slide( data.indexh, data.indexv, data.indexf ); + nextSlide.contentWindow.Reveal.slide( data.nextindexh, data.nextindexv ); }, false ); -- cgit v1.2.3