Create a single fragment event per fragment-index
For backward-compatibility, add a new 'fragments' property to the fragmentshown and fragmenthidden events. The 'fragment' property still returns the first fragment.
This commit is contained in:
		| @@ -1916,10 +1916,10 @@ var Reveal = (function(){ | |||||||
|  |  | ||||||
| 				toArray( fragments ).forEach( function( element ) { | 				toArray( fragments ).forEach( function( element ) { | ||||||
| 					element.classList.add( 'visible' ); | 					element.classList.add( 'visible' ); | ||||||
|  | 				} ); | ||||||
|  |  | ||||||
| 				// Notify subscribers of the change | 				// Notify subscribers of the change | ||||||
| 					dispatchEvent( 'fragmentshown', { fragment: element } ); | 				dispatchEvent( 'fragmentshown', { fragment: fragments[0], fragments: fragments } ); | ||||||
| 				} ); |  | ||||||
|  |  | ||||||
| 				updateControls(); | 				updateControls(); | ||||||
| 				return true; | 				return true; | ||||||
| @@ -1950,10 +1950,10 @@ var Reveal = (function(){ | |||||||
|  |  | ||||||
| 				toArray( fragments ).forEach( function( f ) { | 				toArray( fragments ).forEach( function( f ) { | ||||||
| 					f.classList.remove( 'visible' ); | 					f.classList.remove( 'visible' ); | ||||||
|  | 				} ); | ||||||
|  |  | ||||||
| 				// Notify subscribers of the change | 				// Notify subscribers of the change | ||||||
| 					dispatchEvent( 'fragmenthidden', { fragment: f } ); | 				dispatchEvent( 'fragmenthidden', { fragment: fragments[0], fragments: fragments } ); | ||||||
| 				} ); |  | ||||||
|  |  | ||||||
| 				updateControls(); | 				updateControls(); | ||||||
| 				return true; | 				return true; | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user