Send the correct element for fragmenthidden events
authorRaul Hudea <rhudea@adobe.com>
Wed, 20 Jun 2012 16:12:04 +0000 (19:12 +0300)
committerRaul Hudea <rhudea@adobe.com>
Wed, 20 Jun 2012 16:12:04 +0000 (19:12 +0300)
js/reveal.js

index d3989428bd4c7686b4b6a7129b8e8cabe5d154f8..e753d17d0caccdff5a98ee5bd39175d9e1b5761a 100644 (file)
@@ -822,7 +822,7 @@ var Reveal = (function(){
                                verticalFragments[ verticalFragments.length - 1 ].classList.remove( 'visible' );
 
                                // Notify subscribers of the change
-                               dispatchEvent( 'fragmenthidden', { fragment: verticalFragments[0] } );
+                               dispatchEvent( 'fragmenthidden', { fragment: verticalFragments[ verticalFragments.length - 1 ] } );
                                return true;
                        }
                }
@@ -833,7 +833,7 @@ var Reveal = (function(){
                                horizontalFragments[ horizontalFragments.length - 1 ].classList.remove( 'visible' );
 
                                // Notify subscribers of the change
-                               dispatchEvent( 'fragmenthidden', { fragment: horizontalFragments[0] } );
+                               dispatchEvent( 'fragmenthidden', { fragment: horizontalFragments[ horizontalFragments.length - 1 ] } );
                                return true;
                        }
                }