changed event on slide changed to transitioned as sometimes the scroll would not fire correctly.

This commit is contained in:
2021-04-08 11:32:35 +01:00
parent 08a0906e9f
commit 2185b69500

View File

@@ -37,7 +37,7 @@
plugins: [ RevealMenu ] plugins: [ RevealMenu ]
}).then(() => {Reveal.slide({{ status.last_read_page }})} ); }).then(() => {Reveal.slide({{ status.last_read_page }})} );
Reveal.addEventListener( 'slidechanged', function( event ) { Reveal.addEventListener( 'slidetransitionend', function( event ) {
// event.previousSlide, event.currentSlide, event.indexh, event.indexv // event.previousSlide, event.currentSlide, event.indexh, event.indexv
document.getElementsByClassName('present')[0].scrollIntoView({behavior: 'smooth'}) document.getElementsByClassName('present')[0].scrollIntoView({behavior: 'smooth'})
$.ajax({url: "/comic/set_page/{{nav.cur_path}}/" + event.indexh + "/"}) $.ajax({url: "/comic/set_page/{{nav.cur_path}}/" + event.indexh + "/"})