Fixed issue with getProgress() when called from slidechanged event on edge case

This commit is contained in:
Greg Denehy 2017-11-25 11:07:09 +10:30
parent a0a9aa7821
commit 8579fc773d
1 changed files with 11 additions and 10 deletions

View File

@ -2411,16 +2411,7 @@
// Dispatch an event if the slide changed
var slideChanged = ( indexh !== indexhBefore || indexv !== indexvBefore );
if( slideChanged ) {
dispatchEvent( 'slidechanged', {
'indexh': indexh,
'indexv': indexv,
'previousSlide': previousSlide,
'currentSlide': currentSlide,
'origin': o
} );
}
else {
if (!slideChanged) {
// Ensure that the previous slide is never the same as the current
previousSlide = null;
}
@ -2448,6 +2439,16 @@
}
}
if( slideChanged ) {
dispatchEvent( 'slidechanged', {
'indexh': indexh,
'indexv': indexv,
'previousSlide': previousSlide,
'currentSlide': currentSlide,
'origin': o
} );
}
// Handle embedded content
if( slideChanged || !previousSlide ) {
stopEmbeddedContent( previousSlide );