@egjs/flicking 4.11.3-beta.0 → 4.11.3-beta.2
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/Control.d.ts +1 -1
- package/dist/flicking.cjs.js +8 -8
- package/dist/flicking.cjs.js.map +1 -1
- package/dist/flicking.esm.js +8 -8
- package/dist/flicking.esm.js.map +1 -1
- package/dist/flicking.js +8 -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 +8 -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/Control.ts +3 -3
- package/src/control/SnapControl.ts +4 -4
package/package.json
CHANGED
package/src/control/Control.ts
CHANGED
|
@@ -306,7 +306,7 @@ abstract class Control {
|
|
|
306
306
|
axesEvent?: OnRelease;
|
|
307
307
|
}) {
|
|
308
308
|
const position = this._getPosition(panel, direction);
|
|
309
|
-
this._triggerIndexChangeEvent(panel, panel.position, axesEvent);
|
|
309
|
+
this._triggerIndexChangeEvent(panel, panel.position, axesEvent, direction);
|
|
310
310
|
|
|
311
311
|
return this._animateToPosition({ position, duration, newActivePanel: panel, axesEvent });
|
|
312
312
|
}
|
|
@@ -347,7 +347,7 @@ abstract class Control {
|
|
|
347
347
|
this._controller = control._controller;
|
|
348
348
|
}
|
|
349
349
|
|
|
350
|
-
protected _triggerIndexChangeEvent(panel: Panel, position: number, axesEvent?: OnRelease) {
|
|
350
|
+
protected _triggerIndexChangeEvent(panel: Panel, position: number, axesEvent?: OnRelease, direction?: ValueOf<typeof DIRECTION>) {
|
|
351
351
|
const flicking = getFlickingAttached(this._flicking);
|
|
352
352
|
const triggeringEvent = panel !== this._activePanel ? EVENTS.WILL_CHANGE : EVENTS.WILL_RESTORE;
|
|
353
353
|
const camera = flicking.camera;
|
|
@@ -357,7 +357,7 @@ abstract class Control {
|
|
|
357
357
|
index: panel.index,
|
|
358
358
|
panel,
|
|
359
359
|
isTrusted: axesEvent?.isTrusted || false,
|
|
360
|
-
direction: getDirection(activePanel?.position ?? camera.position, position)
|
|
360
|
+
direction: direction ?? getDirection(activePanel?.position ?? camera.position, position)
|
|
361
361
|
});
|
|
362
362
|
|
|
363
363
|
this._nextPanel = panel;
|
|
@@ -95,7 +95,7 @@ class SnapControl extends Control {
|
|
|
95
95
|
return Promise.reject(new FlickingError(ERROR.MESSAGE.POSITION_NOT_REACHABLE(position), ERROR.CODE.POSITION_NOT_REACHABLE));
|
|
96
96
|
}
|
|
97
97
|
|
|
98
|
-
const snapThreshold = this._calcSnapThreshold(
|
|
98
|
+
const snapThreshold = this._calcSnapThreshold(position, activeAnchor);
|
|
99
99
|
|
|
100
100
|
const posDelta = flicking.animating
|
|
101
101
|
? state.delta
|
|
@@ -210,7 +210,7 @@ class SnapControl extends Control {
|
|
|
210
210
|
return adjacentAnchor;
|
|
211
211
|
}
|
|
212
212
|
|
|
213
|
-
private _calcSnapThreshold(
|
|
213
|
+
private _calcSnapThreshold(position: number, activeAnchor: AnchorPoint): number {
|
|
214
214
|
const isNextDirection = position > activeAnchor.position;
|
|
215
215
|
const panel = activeAnchor.panel;
|
|
216
216
|
const panelSize = panel.size;
|
|
@@ -222,9 +222,9 @@ class SnapControl extends Control {
|
|
|
222
222
|
* |<------>|<------------>|
|
|
223
223
|
* [ |<-Anchor ]
|
|
224
224
|
*/
|
|
225
|
-
return
|
|
225
|
+
return isNextDirection
|
|
226
226
|
? panelSize - alignPos + panel.margin.next
|
|
227
|
-
: alignPos + panel.margin.prev
|
|
227
|
+
: alignPos + panel.margin.prev;
|
|
228
228
|
}
|
|
229
229
|
}
|
|
230
230
|
|