]> git.ipfire.org Git - thirdparty/bootstrap.git/commitdiff
Carousel: rename private property
authorGeoSot <geo.sotis@gmail.com>
Thu, 10 Mar 2022 00:07:01 +0000 (02:07 +0200)
committerXhmikosR <xhmikosr@gmail.com>
Thu, 10 Mar 2022 13:22:14 +0000 (15:22 +0200)
js/src/carousel.js
js/tests/unit/carousel.spec.js

index edaec08f2d4c2d4e8844c3509b159d07deb4baad..5a9b2dc84627bc3c2344234ba70d94be66aa5b90 100644 (file)
@@ -97,7 +97,7 @@ class Carousel extends BaseComponent {
 
     this._interval = null
     this._activeElement = null
-    this._isPaused = false
+    this._stayPaused = false
     this._isSliding = false
     this.touchTimeout = null
     this._swipeHelper = null
@@ -139,7 +139,7 @@ class Carousel extends BaseComponent {
 
   pause(event) {
     if (!event) {
-      this._isPaused = true
+      this._stayPaused = true
     }
 
     if (SelectorEngine.findOne(SELECTOR_NEXT_PREV, this._element)) {
@@ -152,11 +152,11 @@ class Carousel extends BaseComponent {
 
   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)
index 536a60e27191d21ca2f2d10fd2ce5b5b4307cf7b..9817b83f1c6e9945d1835d9334a90134f7df4f53 100644 (file)
@@ -891,7 +891,7 @@ describe('Carousel', () => {
 
       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', () => {
@@ -917,7 +917,7 @@ describe('Carousel', () => {
 
       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', () => {
@@ -942,7 +942,7 @@ describe('Carousel', () => {
       carousel.pause(event)
 
       expect(carousel._clearInterval).toHaveBeenCalled()
-      expect(carousel._isPaused).toBeFalse()
+      expect(carousel._stayPaused).toBeFalse()
     })
   })
 
@@ -988,7 +988,7 @@ describe('Carousel', () => {
 
       spyOn(window, 'setInterval').and.callThrough()
 
-      carousel._isPaused = true
+      carousel._stayPaused = true
       carousel.cycle(true)
 
       expect(window.setInterval).not.toHaveBeenCalled()