Fix the DOCUMENTATION.md for impress:stepenter and impress:stepleave events

Use event.target and event.detail.next in the examples.
This commit is contained in:
Henrik Ingo
2017-11-12 19:11:58 +02:00
parent f7f217114e
commit 8a1384769c

View File

@@ -332,8 +332,8 @@ Triggers the `impress:stepenter` event in the [Root Element](#root-element) when
```JavaScript
var rootElement = document.getElementById( "impress" );
rootElement.addEventListener( "impress:stepenter", function() {
var currentStep = document.querySelector( ".present" );
rootElement.addEventListener( "impress:stepenter", function(event) {
var currentStep = event.target;
console.log( "Entered the Step Element '" + currentStep.id + "'" );
});
```
@@ -344,8 +344,9 @@ Triggers the `impress:stepleave` event in the [Root Element](#root-element) when
```JavaScript
var rootElement = document.getElementById( "impress" );
rootElement.addEventListener( "impress:stepleave", function(event) {
var currentStep = event.target
console.log( "Left the Step Element '" + currentStep.id + "'" );
var currentStep = event.target;
var nextStep = event.detail.next;
console.log( "Left the Step Element '" + currentStep.id + "' and about to enter '" + nextStep.id );
});
```