mirror of
https://github.com/Noratrieb/slides.git
synced 2026-01-14 16:35:07 +01:00
merge support for multiple notes on same slide
This commit is contained in:
commit
01efcf2d92
18 changed files with 52 additions and 32 deletions
|
|
@ -1,5 +1,5 @@
|
|||
/**
|
||||
* Handles the showing and
|
||||
* Handles the showing of speaker notes
|
||||
*/
|
||||
export default class Notes {
|
||||
|
||||
|
|
@ -89,7 +89,7 @@ export default class Notes {
|
|||
* Retrieves the speaker notes from a slide. Notes can be
|
||||
* defined in two ways:
|
||||
* 1. As a data-notes attribute on the slide <section>
|
||||
* 2. As an <aside class="notes"> inside of the slide
|
||||
* 2. With <aside class="notes"> elements inside the slide
|
||||
*
|
||||
* @param {HTMLElement} [slide=currentSlide]
|
||||
* @return {(string|null)}
|
||||
|
|
@ -101,10 +101,14 @@ export default class Notes {
|
|||
return slide.getAttribute( 'data-notes' );
|
||||
}
|
||||
|
||||
// ... or using an <aside class="notes"> element
|
||||
let notesElement = slide.querySelector( 'aside.notes' );
|
||||
if( notesElement ) {
|
||||
return notesElement.innerHTML;
|
||||
// ... or using <aside class="notes"> elements
|
||||
let notesElements = slide.querySelectorAll( 'aside.notes' );
|
||||
if( notesElements ) {
|
||||
let notes = "";
|
||||
for (let i = 0; i < notesElements.length; i++) {
|
||||
notes += notesElements[i].innerHTML + "\n";
|
||||
}
|
||||
return notes;
|
||||
}
|
||||
|
||||
return null;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue