infinity-forge
Version:
31 lines • 1.07 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.default = transitionEmit;
function transitionEmit(_a) {
var swiper = _a.swiper, runCallbacks = _a.runCallbacks, direction = _a.direction, step = _a.step;
var activeIndex = swiper.activeIndex, previousIndex = swiper.previousIndex;
var dir = direction;
if (!dir) {
if (activeIndex > previousIndex)
dir = 'next';
else if (activeIndex < previousIndex)
dir = 'prev';
else
dir = 'reset';
}
swiper.emit("transition".concat(step));
if (runCallbacks && activeIndex !== previousIndex) {
if (dir === 'reset') {
swiper.emit("slideResetTransition".concat(step));
return;
}
swiper.emit("slideChangeTransition".concat(step));
if (dir === 'next') {
swiper.emit("slideNextTransition".concat(step));
}
else {
swiper.emit("slidePrevTransition".concat(step));
}
}
}
//# sourceMappingURL=transitionEmit.js.map