diff options
author | Dmitry Trofimov <dmitry.trofimov@jetbrains.com> | 2016-07-04 16:57:01 +0200 |
---|---|---|
committer | Dmitry Trofimov <dmitry.trofimov@jetbrains.com> | 2016-07-04 16:57:01 +0200 |
commit | 86a3f0276bb654fa8fea281ac1a91b2a05b4f092 (patch) | |
tree | c0db595e7a08cd587baee2bf36c37d4582e8f9a5 /plugin | |
parent | bac187f3a0f7e8f92d33ca0258fe2e96553d2930 (diff) | |
download | perl-software-in-gnu-guix-86a3f0276bb654fa8fea281ac1a91b2a05b4f092.tar perl-software-in-gnu-guix-86a3f0276bb654fa8fea281ac1a91b2a05b4f092.tar.gz |
For a fragment: allow to show a separate note defined in it
When a slide has several fragments it could be convenient to define a note for each of them. In this case we need to show only this specific note defined in a fragment and not others. General note of a slide shouldn't be also shown, as a more specific one should have greater relevance in this case.
Diffstat (limited to 'plugin')
-rw-r--r-- | plugin/notes/notes.js | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/plugin/notes/notes.js b/plugin/notes/notes.js index 88f98d6..46bf5de 100644 --- a/plugin/notes/notes.js +++ b/plugin/notes/notes.js @@ -50,7 +50,7 @@ var RevealNotes = (function() { /** * Posts the current slide data to the notes window */ - function post() { + function post(event) { var slideElement = Reveal.getCurrentSlide(), notesElement = slideElement.querySelector( 'aside.notes' ); @@ -64,6 +64,15 @@ var RevealNotes = (function() { state: Reveal.getState() }; + // Look for notes defined in a fragment, if it is a fragmentshown event + if (event && event.hasOwnProperty('fragment')) { + var innerNotes = event.fragment.querySelector( 'aside.notes' ); + + if ( innerNotes) { + notesElement = innerNotes; + } + } + // Look for notes defined in a slide attribute if( slideElement.hasAttribute( 'data-notes' ) ) { messageData.notes = slideElement.getAttribute( 'data-notes' ); |