@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.esm.js +20 -6
- package/dist/flicking.esm.js.map +1 -1
- package/dist/flicking.js +20 -6
- package/dist/flicking.js.map +1 -1
- package/dist/flicking.min.js +2 -2
- package/dist/flicking.min.js.map +1 -1
- package/dist/flicking.pkgd.js +115 -120
- package/dist/flicking.pkgd.js.map +1 -1
- package/dist/flicking.pkgd.min.js +2 -2
- package/dist/flicking.pkgd.min.js.map +1 -1
- package/package.json +1 -1
- package/src/control/AxesController.ts +1 -1
- package/src/control/SnapControl.ts +15 -3
- package/TODO.md +0 -3
package/package.json
CHANGED
|
@@ -111,10 +111,13 @@ class SnapControl extends Control {
|
|
|
111
111
|
targetAnchor = this._findSnappedAnchor(position, anchorAtCamera);
|
|
112
112
|
} else if (absPosDelta >= flicking.threshold && absPosDelta > 0) {
|
|
113
113
|
// Move to the adjacent panel
|
|
114
|
-
targetAnchor = this._findAdjacentAnchor(posDelta, anchorAtCamera);
|
|
114
|
+
targetAnchor = this._findAdjacentAnchor(position, posDelta, anchorAtCamera);
|
|
115
115
|
} else {
|
|
116
116
|
// Restore to active panel
|
|
117
|
-
|
|
117
|
+
return this.moveToPanel(activeAnchor.panel, {
|
|
118
|
+
duration,
|
|
119
|
+
axesEvent
|
|
120
|
+
});
|
|
118
121
|
}
|
|
119
122
|
|
|
120
123
|
this._triggerIndexChangeEvent(targetAnchor.panel, position, axesEvent);
|
|
@@ -190,9 +193,18 @@ class SnapControl extends Control {
|
|
|
190
193
|
}
|
|
191
194
|
}
|
|
192
195
|
|
|
193
|
-
private _findAdjacentAnchor(posDelta: number, anchorAtCamera: AnchorPoint): AnchorPoint {
|
|
196
|
+
private _findAdjacentAnchor(position: number, posDelta: number, anchorAtCamera: AnchorPoint): AnchorPoint {
|
|
194
197
|
const flicking = getFlickingAttached(this._flicking);
|
|
195
198
|
const camera = flicking.camera;
|
|
199
|
+
|
|
200
|
+
if (camera.circularEnabled) {
|
|
201
|
+
const anchorIncludePosition = camera.findAnchorIncludePosition(position);
|
|
202
|
+
|
|
203
|
+
if (anchorIncludePosition && anchorIncludePosition.position !== anchorAtCamera.position) {
|
|
204
|
+
return anchorIncludePosition;
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
|
|
196
208
|
const adjacentAnchor = (posDelta > 0 ? camera.getNextAnchor(anchorAtCamera) : camera.getPrevAnchor(anchorAtCamera)) ?? anchorAtCamera;
|
|
197
209
|
|
|
198
210
|
return adjacentAnchor;
|
package/TODO.md
DELETED