1
0
mirror of https://github.com/hakimel/reveal.js.git synced 2025-01-17 13:28:29 +01:00

fix broken mobile scroll view navigation where there were fragments starting at an index above 1 #3540

This commit is contained in:
Hakim El Hattab 2023-11-30 19:05:37 +01:00
parent bf285afcf2
commit d5896c968b
5 changed files with 14 additions and 14 deletions

2
dist/reveal.esm.js vendored

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

2
dist/reveal.js vendored

File diff suppressed because one or more lines are too long

2
dist/reveal.js.map vendored

File diff suppressed because one or more lines are too long

View File

@ -425,7 +425,6 @@ export default class ScrollView {
]; ];
const scrollTriggerSegmentSize = ( trigger.range[1] - trigger.range[0] ) / trigger.page.scrollTriggers.length; const scrollTriggerSegmentSize = ( trigger.range[1] - trigger.range[0] ) / trigger.page.scrollTriggers.length;
// Set the range for each inner scroll trigger // Set the range for each inner scroll trigger
trigger.page.scrollTriggers.forEach( ( scrollTrigger, i ) => { trigger.page.scrollTriggers.forEach( ( scrollTrigger, i ) => {
scrollTrigger.range = [ scrollTrigger.range = [
@ -462,16 +461,17 @@ export default class ScrollView {
activate: () => { activate: () => {
this.Reveal.fragments.update( -1, page.fragments, slideElement ); this.Reveal.fragments.update( -1, page.fragments, slideElement );
} }
}, }
// Triggers for each fragment group
...fragmentGroups.map( ( fragments, i ) => ({
activate: () => {
this.Reveal.fragments.update( i, page.fragments, slideElement );
}
})
)
); );
// Triggers for each fragment group
fragmentGroups.forEach( ( fragments, i ) => {
page.scrollTriggers.push({
activate: () => {
this.Reveal.fragments.update( i, page.fragments, slideElement );
}
});
} );
} }