Merge pull request #2836 from lechten/fix-progress-click
Fix target for click on progress bar
This commit is contained in:
commit
49d043c0c2
@ -88,14 +88,16 @@ export default class Progress {
|
|||||||
|
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
|
|
||||||
let slidesTotal = this.Reveal.getHorizontalSlides().length;
|
let slides = this.Reveal.getSlides();
|
||||||
|
let slidesTotal = slides.length;
|
||||||
let slideIndex = Math.floor( ( event.clientX / this.getMaxWidth() ) * slidesTotal );
|
let slideIndex = Math.floor( ( event.clientX / this.getMaxWidth() ) * slidesTotal );
|
||||||
|
|
||||||
if( this.Reveal.getConfig().rtl ) {
|
if( this.Reveal.getConfig().rtl ) {
|
||||||
slideIndex = slidesTotal - slideIndex;
|
slideIndex = slidesTotal - slideIndex;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.Reveal.slide( slideIndex );
|
let targetIndices = this.Reveal.getIndices(slides[slideIndex]);
|
||||||
|
this.Reveal.slide( targetIndices.h, targetIndices.v );
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user