@egjs/flicking 4.8.0 → 4.8.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/flicking.js CHANGED
@@ -4,7 +4,7 @@ name: @egjs/flicking
4
4
  license: MIT
5
5
  author: NAVER Corp.
6
6
  repository: https://github.com/naver/egjs-flicking
7
- version: 4.8.0
7
+ version: 4.8.1
8
8
  */
9
9
  (function (global, factory) {
10
10
  typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('@egjs/component'), require('@egjs/axes'), require('@egjs/imready')) :
@@ -2200,7 +2200,9 @@ version: 4.8.0
2200
2200
  };
2201
2201
 
2202
2202
  this._onAxesChange = function () {
2203
- _this._dragged = true;
2203
+ var _a;
2204
+
2205
+ _this._dragged = !!((_a = _this._panInput) === null || _a === void 0 ? void 0 : _a.isEnabled());
2204
2206
  };
2205
2207
 
2206
2208
  this._preventClickWhenDragged = function (e) {
@@ -3181,10 +3183,13 @@ version: 4.8.0
3181
3183
  targetAnchor = this._findSnappedAnchor(position, anchorAtCamera);
3182
3184
  } else if (absPosDelta >= flicking.threshold && absPosDelta > 0) {
3183
3185
  // Move to the adjacent panel
3184
- targetAnchor = this._findAdjacentAnchor(posDelta, anchorAtCamera);
3186
+ targetAnchor = this._findAdjacentAnchor(position, posDelta, anchorAtCamera);
3185
3187
  } else {
3186
3188
  // Restore to active panel
3187
- targetAnchor = anchorAtCamera;
3189
+ return this.moveToPanel(activeAnchor.panel, {
3190
+ duration: duration,
3191
+ axesEvent: axesEvent
3192
+ });
3188
3193
  }
3189
3194
 
3190
3195
  this._triggerIndexChangeEvent(targetAnchor.panel, position, axesEvent);
@@ -3255,11 +3260,20 @@ version: 4.8.0
3255
3260
  }
3256
3261
  };
3257
3262
 
3258
- __proto._findAdjacentAnchor = function (posDelta, anchorAtCamera) {
3263
+ __proto._findAdjacentAnchor = function (position, posDelta, anchorAtCamera) {
3259
3264
  var _a;
3260
3265
 
3261
3266
  var flicking = getFlickingAttached(this._flicking);
3262
3267
  var camera = flicking.camera;
3268
+
3269
+ if (camera.circularEnabled) {
3270
+ var anchorIncludePosition = camera.findAnchorIncludePosition(position);
3271
+
3272
+ if (anchorIncludePosition && anchorIncludePosition.position !== anchorAtCamera.position) {
3273
+ return anchorIncludePosition;
3274
+ }
3275
+ }
3276
+
3263
3277
  var adjacentAnchor = (_a = posDelta > 0 ? camera.getNextAnchor(anchorAtCamera) : camera.getPrevAnchor(anchorAtCamera)) !== null && _a !== void 0 ? _a : anchorAtCamera;
3264
3278
  return adjacentAnchor;
3265
3279
  };
@@ -8550,7 +8564,7 @@ version: 4.8.0
8550
8564
  */
8551
8565
 
8552
8566
 
8553
- Flicking.VERSION = "4.8.0";
8567
+ Flicking.VERSION = "4.8.1";
8554
8568
  return Flicking;
8555
8569
  }(Component);
8556
8570