merge notes float fix and support for multiple fragments with same index
This commit is contained in:
		
							
								
								
									
										28
									
								
								js/reveal.js
									
									
									
									
									
								
							
							
						
						
									
										28
									
								
								js/reveal.js
									
									
									
									
									
								
							| @@ -1632,10 +1632,18 @@ var Reveal = (function(){ | |||||||
| 			var fragments = sortFragments( currentSlide.querySelectorAll( '.fragment:not(.visible)' ) ); | 			var fragments = sortFragments( currentSlide.querySelectorAll( '.fragment:not(.visible)' ) ); | ||||||
|  |  | ||||||
| 			if( fragments.length ) { | 			if( fragments.length ) { | ||||||
| 				fragments[0].classList.add( 'visible' ); | 				// There may be multiple fragments with the same index. We want to display all of them. | ||||||
|  | 				var nextFragmentIndex = fragments[0].getAttribute( 'data-fragment-index' ); | ||||||
| 				 | 				 | ||||||
| 				// Notify subscribers of the change | 				toArray( fragments ).forEach( function( thisFragment ) { | ||||||
| 				dispatchEvent( 'fragmentshown', { fragment: fragments[0] } ); | 					var f = thisFragment.getAttribute( 'data-fragment-index' ); | ||||||
|  | 					if( f === nextFragmentIndex ) { | ||||||
|  | 						thisFragment.classList.add( 'visible' ); | ||||||
|  | 						 | ||||||
|  | 						// Notify subscribers of the change | ||||||
|  | 						dispatchEvent( 'fragmentshown', { fragment: thisFragment } ); | ||||||
|  | 					} | ||||||
|  | 				} ); | ||||||
| 				 | 				 | ||||||
| 				updateControls(); | 				updateControls(); | ||||||
| 				return true; | 				return true; | ||||||
| @@ -1658,10 +1666,18 @@ var Reveal = (function(){ | |||||||
| 			var fragments = sortFragments( currentSlide.querySelectorAll( '.fragment.visible' ) ); | 			var fragments = sortFragments( currentSlide.querySelectorAll( '.fragment.visible' ) ); | ||||||
|  |  | ||||||
| 			if( fragments.length ) { | 			if( fragments.length ) { | ||||||
| 				fragments[ fragments.length - 1 ].classList.remove( 'visible' ); | 				// There may be multiple fragments with the same index. We want to display all of them. | ||||||
|  | 				var prevFragmentIndex = fragments[0].getAttribute( 'data-fragment-index' ); | ||||||
| 				 | 				 | ||||||
| 				// Notify subscribers of the change | 				toArray( fragments ).forEach( function( thisFragment ) { | ||||||
| 				dispatchEvent( 'fragmenthidden', { fragment: fragments[ fragments.length - 1 ] } ); | 					var f = thisFragment.getAttribute( 'data-fragment-index' ); | ||||||
|  | 					if( f === prevFragmentIndex ) { | ||||||
|  | 						thisFragment.classList.remove( 'visible' ); | ||||||
|  | 						 | ||||||
|  | 						// Notify subscribers of the change | ||||||
|  | 						dispatchEvent( 'fragmenthidden', { fragment: thisFragment } ); | ||||||
|  | 					} | ||||||
|  | 				} ); | ||||||
|  |  | ||||||
| 				updateControls(); | 				updateControls(); | ||||||
| 				return true; | 				return true; | ||||||
|   | |||||||
| @@ -14,6 +14,7 @@ | |||||||
| 				font-size: 24px; | 				font-size: 24px; | ||||||
| 				width: 640px; | 				width: 640px; | ||||||
| 				margin-top: 5px; | 				margin-top: 5px; | ||||||
|  | 				clear: left; | ||||||
| 			} | 			} | ||||||
|  |  | ||||||
| 			#wrap-current-slide { | 			#wrap-current-slide { | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user