@egjs/flicking 4.14.1-beta.3 → 4.14.2-beta.0
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/declaration/control/AxesController.d.ts +1 -0
- package/dist/flicking.cjs.js +24 -8
- package/dist/flicking.cjs.js.map +1 -1
- package/dist/flicking.esm.js +24 -8
- package/dist/flicking.esm.js.map +1 -1
- package/dist/flicking.js +24 -8
- 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 +24 -8
- 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 +9 -1
- package/src/control/Control.ts +9 -2
- package/src/control/StrictControl.ts +3 -2
- package/src/core/AutoResizer.ts +3 -0
package/package.json
CHANGED
|
@@ -345,7 +345,7 @@ class AxesController {
|
|
|
345
345
|
return Promise.reject(new FlickingError(ERROR.MESSAGE.NOT_ATTACHED_TO_FLICKING, ERROR.CODE.NOT_ATTACHED_TO_FLICKING));
|
|
346
346
|
}
|
|
347
347
|
|
|
348
|
-
const startPos =
|
|
348
|
+
const startPos = this.getCurrentPosition();
|
|
349
349
|
|
|
350
350
|
if (startPos === position) {
|
|
351
351
|
const flicking = getFlickingAttached(this._flicking);
|
|
@@ -396,6 +396,14 @@ class AxesController {
|
|
|
396
396
|
});
|
|
397
397
|
}
|
|
398
398
|
|
|
399
|
+
/**
|
|
400
|
+
* 현재
|
|
401
|
+
* @returns
|
|
402
|
+
*/
|
|
403
|
+
public getCurrentPosition() {
|
|
404
|
+
return this._axes?.get([AXES.POSITION_KEY])[AXES.POSITION_KEY] ?? 0;
|
|
405
|
+
}
|
|
406
|
+
|
|
399
407
|
public updateDirection() {
|
|
400
408
|
const flicking = getFlickingAttached(this._flicking);
|
|
401
409
|
const axes = this._axes!;
|
package/src/control/Control.ts
CHANGED
|
@@ -380,12 +380,19 @@ abstract class Control {
|
|
|
380
380
|
axesEvent?: OnRelease;
|
|
381
381
|
}) {
|
|
382
382
|
const flicking = getFlickingAttached(this._flicking);
|
|
383
|
-
|
|
383
|
+
|
|
384
|
+
// 거리(1px 미만)가 매우 짧은 경우 duration이 늘어지는걸 방지하기 위해 0으로 바꿔 즉시 변경
|
|
385
|
+
let nextDuration = duration;
|
|
386
|
+
|
|
387
|
+
if (Math.abs(nextDuration - position) < 0.5) {
|
|
388
|
+
nextDuration = 0;
|
|
389
|
+
}
|
|
390
|
+
const animate = () => this._controller.animateTo(position, nextDuration, axesEvent);
|
|
384
391
|
const state = this._controller.state;
|
|
385
392
|
|
|
386
393
|
state.targetPanel = newActivePanel;
|
|
387
394
|
|
|
388
|
-
if (
|
|
395
|
+
if (nextDuration <= 0) {
|
|
389
396
|
return animate();
|
|
390
397
|
} else {
|
|
391
398
|
return animate().then(async () => {
|
|
@@ -220,8 +220,9 @@ class StrictControl extends Control {
|
|
|
220
220
|
const firstAnchor = anchors[0];
|
|
221
221
|
const lastAnchor = anchors[anchors.length - 1];
|
|
222
222
|
|
|
223
|
-
|
|
224
|
-
const
|
|
223
|
+
// position이 bounce으로 인하여 범위를 넘어가야 동작하도록 변경
|
|
224
|
+
const shouldBounceToFirst = position < cameraRange.min && isBetween(firstAnchor.panel.index, indexRange.min, indexRange.max);
|
|
225
|
+
const shouldBounceToLast = position > cameraRange.max && isBetween(lastAnchor.panel.index, indexRange.min, indexRange.max);
|
|
225
226
|
|
|
226
227
|
const isAdjacent = adjacentAnchor && (indexRange.min <= indexRange.max
|
|
227
228
|
? isBetween(adjacentAnchor.index, indexRange.min, indexRange.max)
|