diff options
author | Hakim El Hattab <hakim.elhattab@gmail.com> | 2016-05-26 09:57:19 +0200 |
---|---|---|
committer | Hakim El Hattab <hakim.elhattab@gmail.com> | 2016-05-26 09:57:27 +0200 |
commit | 3111d3b1ae12af2580cb45a18da208146701a6fd (patch) | |
tree | 1d873aac1b7299a8dd5ad8fac208983d3d03bb40 /js/reveal.js | |
parent | e93afb7289d4d272b0751b7ce97e980cbce4a6ba (diff) | |
download | fosdem-2018-presentation-3111d3b1ae12af2580cb45a18da208146701a6fd.tar fosdem-2018-presentation-3111d3b1ae12af2580cb45a18da208146701a6fd.tar.gz |
support for 'separate-page' layout for notes in PDF exports #1518
Diffstat (limited to 'js/reveal.js')
-rw-r--r-- | js/reveal.js | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/js/reveal.js b/js/reveal.js index 656ed10..f43e0aa 100644 --- a/js/reveal.js +++ b/js/reveal.js @@ -624,18 +624,31 @@ // Inject notes if `showNotes` is enabled if( config.showNotes ) { + + // Are there notes for this slide? var notes = getSlideNotes( slide ); if( notes ) { + var notesSpacing = 8; + var notesLayout = typeof config.showNotes === 'string' ? config.showNotes : 'inline'; var notesElement = document.createElement( 'div' ); notesElement.classList.add( 'speaker-notes' ); notesElement.classList.add( 'speaker-notes-pdf' ); + notesElement.setAttribute( 'data-layout', notesLayout ); notesElement.innerHTML = notes; - notesElement.style.left = ( notesSpacing - left ) + 'px'; - notesElement.style.bottom = ( notesSpacing - top ) + 'px'; - notesElement.style.width = ( pageWidth - notesSpacing*2 ) + 'px'; - slide.appendChild( notesElement ); + + if( notesLayout === 'separate-page' ) { + page.parentNode.insertBefore( notesElement, page.nextSibling ); + } + else { + notesElement.style.left = ( notesSpacing - left ) + 'px'; + notesElement.style.bottom = ( notesSpacing - top ) + 'px'; + notesElement.style.width = ( pageWidth - notesSpacing*2 ) + 'px'; + slide.appendChild( notesElement ); + } + } + } // Inject slide numbers if `slideNumbers` are enabled |