From 90df0889345c15a3969a92cec00e90e4a3e79649 Mon Sep 17 00:00:00 2001 From: daviddalbusco Date: Wed, 28 Nov 2018 10:22:07 +0100 Subject: [PATCH] refactor: rename slideStart to slideDidChange --- doc/features/extra.md | 4 ++-- doc/features/navigation.md | 4 ++-- src/components/deck/deckdeckgo-deck/deckdeckgo-deck.tsx | 8 ++++---- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/doc/features/extra.md b/doc/features/extra.md index b1741c096..1757d1b65 100644 --- a/doc/features/extra.md +++ b/doc/features/extra.md @@ -37,8 +37,8 @@ await deck.print(); | Event | Emitted value | Description | | -------------------------- |:-----------------:|:-----------------:| -| slideNextStart | number | Emitted when the next slide has started. Emit the index of the new active slide. | -| slidePrevStart | number | Emitted when the previous slide has ended. Emit the index of the new active slide. | +| slideNextDidChange | number | Emitted when the next slide has started. Emit the index of the new active slide. | +| slidePrevDidChange | number | Emitted when the previous slide has ended. Emit the index of the new active slide. | | slideDrag | number | Emitted when the slider is actively being moved. Emit the transformX value of the deck. | | slideWillChange | number | Emitted before the active slide has changed. Emit the transformX value of the deck. | diff --git a/doc/features/navigation.md b/doc/features/navigation.md index edcf1770e..6941844a5 100644 --- a/doc/features/navigation.md +++ b/doc/features/navigation.md @@ -32,7 +32,7 @@ const deck = document.getElementsByTagName('deckgo-deck'); await deck.slideNext(); ``` -*Optional parameter:* Optionally your could provide a boolean parameter to this method in case you would not like the event `slideNextStart` and `slidePrevStart` to be fired. +*Optional parameter:* Optionally your could provide a boolean parameter to this method in case you would not like the event `slideNextDidChange` and `slidePrevDidChange` to be fired. ``` await deck.slideNext(false); @@ -44,7 +44,7 @@ await deck.slideNext(false); await deck.slidePrev(); ``` -*Optional parameter:* Optionally your could provide a boolean parameter to this method in case you would not like the event `slideNextStart` and `slidePrevStart` to be fired. +*Optional parameter:* Optionally your could provide a boolean parameter to this method in case you would not like the event `slideNextDidChange` and `slidePrevDidChange` to be fired. ``` await deck.slidePrev(false); diff --git a/src/components/deck/deckdeckgo-deck/deckdeckgo-deck.tsx b/src/components/deck/deckdeckgo-deck/deckdeckgo-deck.tsx index c3683cc75..990c57044 100644 --- a/src/components/deck/deckdeckgo-deck/deckdeckgo-deck.tsx +++ b/src/components/deck/deckdeckgo-deck/deckdeckgo-deck.tsx @@ -34,8 +34,8 @@ export class DeckdeckgoDeck { @State() private length: number = 0; - @Event() slideNextStart: EventEmitter; - @Event() slidePrevStart: EventEmitter; + @Event() slideNextDidChange: EventEmitter; + @Event() slidePrevDidChange: EventEmitter; @Event() slideDrag: EventEmitter; @Event() slideWillChange: EventEmitter; @@ -174,13 +174,13 @@ export class DeckdeckgoDeck { this.activeIndex++; if (emitEvent) { - this.slideNextStart.emit(this.activeIndex); + this.slideNextDidChange.emit(this.activeIndex); } } else { this.activeIndex--; if (emitEvent) { - this.slidePrevStart.emit(this.activeIndex); + this.slidePrevDidChange.emit(this.activeIndex); } } }