@exadel/esl
Version:
Exadel Smart Library (ESL) is the lightweight custom elements library that provide a set of super-flexible components
18 lines (17 loc) • 779 B
JavaScript
/**
* ESLCarouselAutoplayEvent (esl:autoplay:change) event is dispatched by {@link ESLCarouselAutoplayMixin}
* on the host {@link ESLCarousel} element when autoplay state changes.
* It indicates whether autoplay is enabled or disabled, or notifies about the current autoplay cycle start.
*/
export class ESLCarouselAutoplayEvent extends Event {
constructor(init) {
super(ESLCarouselAutoplayEvent.NAME, { bubbles: false, cancelable: false });
Object.assign(this, init);
}
static dispatch(plugin, duration) {
const { enabled, active } = plugin;
const event = new ESLCarouselAutoplayEvent({ enabled, active, duration });
return plugin.$host.dispatchEvent(event);
}
}
ESLCarouselAutoplayEvent.NAME = 'esl:autoplay:change';