Skip to content

Commit

Permalink
Merge pull request hakimel#1636 from traff/master
Browse files Browse the repository at this point in the history
For a fragment: allow to show a separate note defined in it
  • Loading branch information
hakimel authored Jan 31, 2017
2 parents 3bcd167 + 86a3f02 commit 1413cbc
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion plugin/notes/notes.js
Original file line number Diff line number Diff line change
Expand Up @@ -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' );
Expand All @@ -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' );
Expand Down

0 comments on commit 1413cbc

Please sign in to comment.