Fixed issue with getProgress() when called from slidechanged event on edge case
This commit is contained in:
		
							
								
								
									
										21
									
								
								js/reveal.js
									
									
									
									
									
								
							
							
						
						
									
										21
									
								
								js/reveal.js
									
									
									
									
									
								
							| @@ -2411,16 +2411,7 @@ | |||||||
|  |  | ||||||
| 		// Dispatch an event if the slide changed | 		// Dispatch an event if the slide changed | ||||||
| 		var slideChanged = ( indexh !== indexhBefore || indexv !== indexvBefore ); | 		var slideChanged = ( indexh !== indexhBefore || indexv !== indexvBefore ); | ||||||
| 		if( slideChanged ) { | 		if (!slideChanged) { | ||||||
| 			dispatchEvent( 'slidechanged', { |  | ||||||
| 				'indexh': indexh, |  | ||||||
| 				'indexv': indexv, |  | ||||||
| 				'previousSlide': previousSlide, |  | ||||||
| 				'currentSlide': currentSlide, |  | ||||||
| 				'origin': o |  | ||||||
| 			} ); |  | ||||||
| 		} |  | ||||||
| 		else { |  | ||||||
| 			// Ensure that the previous slide is never the same as the current | 			// Ensure that the previous slide is never the same as the current | ||||||
| 			previousSlide = null; | 			previousSlide = null; | ||||||
| 		} | 		} | ||||||
| @@ -2448,6 +2439,16 @@ | |||||||
| 			} | 			} | ||||||
| 		} | 		} | ||||||
|  |  | ||||||
|  | 		if( slideChanged ) { | ||||||
|  | 			dispatchEvent( 'slidechanged', { | ||||||
|  | 				'indexh': indexh, | ||||||
|  | 				'indexv': indexv, | ||||||
|  | 				'previousSlide': previousSlide, | ||||||
|  | 				'currentSlide': currentSlide, | ||||||
|  | 				'origin': o | ||||||
|  | 			} ); | ||||||
|  | 		} | ||||||
|  |  | ||||||
| 		// Handle embedded content | 		// Handle embedded content | ||||||
| 		if( slideChanged || !previousSlide ) { | 		if( slideChanged || !previousSlide ) { | ||||||
| 			stopEmbeddedContent( previousSlide ); | 			stopEmbeddedContent( previousSlide ); | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user