Trigger event on substep enter (#730)

This commit is contained in:
Will Soares
2019-04-25 07:41:50 -03:00
committed by Henrik Ingo
parent c6d468ed26
commit c61403d57a
3 changed files with 18 additions and 6 deletions

View File

@@ -1331,7 +1331,7 @@
reloadTimeout( event );
}, false );
document.addEventListener( "impress:substep:stepleaveaborted", function( event ) {
document.addEventListener( "impress:substep:enter", function( event ) {
reloadTimeout( event );
}, false );
@@ -3957,10 +3957,13 @@
if ( el ) {
// Send a message to others, that we aborted a stepleave event.
// Autoplay will reload itself from this, as there won't be a stepenter event now.
triggerEvent( step, "impress:substep:stepleaveaborted",
{ reason: "next", substep: el } );
// Autoplay uses this for reloading itself
triggerEvent( step, "impress:substep:enter",
{ reason: "next", substep: el } );
// Returning false aborts the stepleave event
return false;
}
@@ -3970,6 +3973,10 @@
if ( el ) {
triggerEvent( step, "impress:substep:stepleaveaborted",
{ reason: "prev", substep: el } );
triggerEvent( step, "impress:substep:leave",
{ reason: "prev", substep: el } );
return false;
}
}
@@ -4032,7 +4039,6 @@
} )( document, window );
/**
* Support for swipe and tap on touch devices
*

View File

@@ -75,7 +75,7 @@
reloadTimeout( event );
}, false );
document.addEventListener( "impress:substep:stepleaveaborted", function( event ) {
document.addEventListener( "impress:substep:enter", function( event ) {
reloadTimeout( event );
}, false );

View File

@@ -34,10 +34,13 @@
if ( el ) {
// Send a message to others, that we aborted a stepleave event.
// Autoplay will reload itself from this, as there won't be a stepenter event now.
triggerEvent( step, "impress:substep:stepleaveaborted",
{ reason: "next", substep: el } );
// Autoplay uses this for reloading itself
triggerEvent( step, "impress:substep:enter",
{ reason: "next", substep: el } );
// Returning false aborts the stepleave event
return false;
}
@@ -47,6 +50,10 @@
if ( el ) {
triggerEvent( step, "impress:substep:stepleaveaborted",
{ reason: "prev", substep: el } );
triggerEvent( step, "impress:substep:leave",
{ reason: "prev", substep: el } );
return false;
}
}
@@ -108,4 +115,3 @@
}, false );
} )( document, window );