this._interval = null
this._activeElement = null
- this._isPaused = false
+ this._stayPaused = false
this._isSliding = false
this.touchTimeout = null
this._swipeHelper = null
pause(event) {
if (!event) {
- this._isPaused = true
+ this._stayPaused = true
}
if (SelectorEngine.findOne(SELECTOR_NEXT_PREV, this._element)) {
cycle(event) {
if (!event) {
- this._isPaused = false
+ this._stayPaused = false
}
this._clearInterval()
- if (this._config.interval && !this._isPaused) {
+ if (this._config.interval && !this._stayPaused) {
this._updateInterval()
this._interval = setInterval(() => this.nextWhenVisible(), this._config.interval)
expect(carousel.cycle).toHaveBeenCalledWith(true)
expect(carousel._clearInterval).toHaveBeenCalled()
- expect(carousel._isPaused).toBeTrue()
+ expect(carousel._stayPaused).toBeTrue()
})
it('should not call cycle if nothing is in transition', () => {
expect(carousel.cycle).not.toHaveBeenCalled()
expect(carousel._clearInterval).toHaveBeenCalled()
- expect(carousel._isPaused).toBeTrue()
+ expect(carousel._stayPaused).toBeTrue()
})
it('should not set is paused at true if an event is passed', () => {
carousel.pause(event)
expect(carousel._clearInterval).toHaveBeenCalled()
- expect(carousel._isPaused).toBeFalse()
+ expect(carousel._stayPaused).toBeFalse()
})
})
spyOn(window, 'setInterval').and.callThrough()
- carousel._isPaused = true
+ carousel._stayPaused = true
carousel.cycle(true)
expect(window.setInterval).not.toHaveBeenCalled()