@egjs/flicking 4.10.5 → 4.10.6

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.10.5
7
+ version: 4.10.6
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')) :
@@ -2639,11 +2639,9 @@ version: 4.10.5
2639
2639
 
2640
2640
 
2641
2641
  __proto.animateTo = function (position, duration, axesEvent) {
2642
- var _a;
2643
-
2644
2642
  var _this = this;
2645
2643
 
2646
- var _b;
2644
+ var _a;
2647
2645
 
2648
2646
  var axes = this._axes;
2649
2647
  var state = this._stateMachine.state;
@@ -2659,7 +2657,7 @@ version: 4.10.5
2659
2657
  flicking.camera.lookAt(position);
2660
2658
 
2661
2659
  if (state.targetPanel) {
2662
- flicking.control.setActive(state.targetPanel, flicking.control.activePanel, (_b = axesEvent === null || axesEvent === void 0 ? void 0 : axesEvent.isTrusted) !== null && _b !== void 0 ? _b : false);
2660
+ flicking.control.setActive(state.targetPanel, flicking.control.activePanel, (_a = axesEvent === null || axesEvent === void 0 ? void 0 : axesEvent.isTrusted) !== null && _a !== void 0 ? _a : false);
2663
2661
  }
2664
2662
 
2665
2663
  return Promise.resolve();
@@ -2691,30 +2689,21 @@ version: 4.10.5
2691
2689
  }
2692
2690
  };
2693
2691
 
2694
- if (duration === 0) {
2695
- var flicking = getFlickingAttached(this._flicking);
2696
- var camera = flicking.camera;
2697
- animate();
2698
- var newPos = flicking.circularEnabled ? circulatePosition(position, camera.range.min, camera.range.max) : position;
2699
- axes.axisManager.set((_a = {}, _a[POSITION_KEY] = newPos, _a));
2700
- return Promise.resolve();
2701
- } else {
2702
- return new Promise(function (resolve, reject) {
2703
- var animationFinishHandler = function () {
2704
- axes.off(EVENT.HOLD, interruptionHandler);
2705
- resolve();
2706
- };
2692
+ return new Promise(function (resolve, reject) {
2693
+ var animationFinishHandler = function () {
2694
+ axes.off(EVENT.HOLD, interruptionHandler);
2695
+ resolve();
2696
+ };
2707
2697
 
2708
- var interruptionHandler = function () {
2709
- axes.off(EVENT.FINISH, animationFinishHandler);
2710
- reject(new FlickingError(MESSAGE.ANIMATION_INTERRUPTED, CODE.ANIMATION_INTERRUPTED));
2711
- };
2698
+ var interruptionHandler = function () {
2699
+ axes.off(EVENT.FINISH, animationFinishHandler);
2700
+ reject(new FlickingError(MESSAGE.ANIMATION_INTERRUPTED, CODE.ANIMATION_INTERRUPTED));
2701
+ };
2712
2702
 
2713
- axes.once(EVENT.FINISH, animationFinishHandler);
2714
- axes.once(EVENT.HOLD, interruptionHandler);
2715
- animate();
2716
- });
2717
- }
2703
+ axes.once(EVENT.FINISH, animationFinishHandler);
2704
+ axes.once(EVENT.HOLD, interruptionHandler);
2705
+ animate();
2706
+ });
2718
2707
  };
2719
2708
 
2720
2709
  __proto.updateDirection = function () {
@@ -5039,7 +5028,7 @@ version: 4.10.5
5039
5028
  var el = this._el;
5040
5029
  var flicking = getFlickingAttached(this._flicking);
5041
5030
  var renderer = flicking.renderer;
5042
- if (renderer.rendering) return this;
5031
+ if (renderer.rendering || !flicking.initialized) return this;
5043
5032
  var actualPosition = this._position - this._alignPos - this._offset + this._circularOffset;
5044
5033
  el.style[this._transform] = flicking.horizontal ? "translate(" + -actualPosition + "px)" : "translate(0, " + -actualPosition + "px)";
5045
5034
  return this;
@@ -5763,6 +5752,11 @@ version: 4.10.5
5763
5752
  });
5764
5753
  };
5765
5754
 
5755
+ __proto._afterRender = function () {
5756
+ var flicking = getFlickingAttached(this._flicking);
5757
+ flicking.camera.applyTransform();
5758
+ };
5759
+
5766
5760
  return Renderer;
5767
5761
  }();
5768
5762
 
@@ -5793,6 +5787,8 @@ version: 4.10.5
5793
5787
 
5794
5788
  this._resetPanelElementOrder();
5795
5789
 
5790
+ this._afterRender();
5791
+
5796
5792
  return [2
5797
5793
  /*return*/
5798
5794
  ];
@@ -8151,14 +8147,13 @@ version: 4.10.5
8151
8147
  }
8152
8148
 
8153
8149
  renderer.checkPanelContentsReady(renderer.panels);
8150
+ this._initialized = true;
8154
8151
  return renderer.render().then(function () {
8155
8152
  // Done initializing & emit ready event
8156
8153
  _this._plugins.forEach(function (plugin) {
8157
8154
  return plugin.init(_this);
8158
8155
  });
8159
8156
 
8160
- _this._initialized = true;
8161
-
8162
8157
  if (preventEventsBeforeInit) {
8163
8158
  _this.trigger = originalTrigger;
8164
8159
  }
@@ -8933,7 +8928,7 @@ version: 4.10.5
8933
8928
  */
8934
8929
 
8935
8930
 
8936
- Flicking.VERSION = "4.10.5";
8931
+ Flicking.VERSION = "4.10.6";
8937
8932
  return Flicking;
8938
8933
  }(Component);
8939
8934