@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.
@@ -54,5 +54,6 @@ declare abstract class Renderer {
54
54
  protected _removeAllChildsFromCamera(): void;
55
55
  protected _insertPanelElements(panels: Panel[], nextSibling?: Panel | null): void;
56
56
  protected _removePanelElements(panels: Panel[]): void;
57
+ protected _afterRender(): void;
57
58
  }
58
59
  export default Renderer;
@@ -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
  import Component, { ComponentEvent } from '@egjs/component';
10
10
  import Axes, { PanInput } from '@egjs/axes';
@@ -2593,11 +2593,9 @@ function () {
2593
2593
 
2594
2594
 
2595
2595
  __proto.animateTo = function (position, duration, axesEvent) {
2596
- var _a;
2597
-
2598
2596
  var _this = this;
2599
2597
 
2600
- var _b;
2598
+ var _a;
2601
2599
 
2602
2600
  var axes = this._axes;
2603
2601
  var state = this._stateMachine.state;
@@ -2613,7 +2611,7 @@ function () {
2613
2611
  flicking.camera.lookAt(position);
2614
2612
 
2615
2613
  if (state.targetPanel) {
2616
- flicking.control.setActive(state.targetPanel, flicking.control.activePanel, (_b = axesEvent === null || axesEvent === void 0 ? void 0 : axesEvent.isTrusted) !== null && _b !== void 0 ? _b : false);
2614
+ flicking.control.setActive(state.targetPanel, flicking.control.activePanel, (_a = axesEvent === null || axesEvent === void 0 ? void 0 : axesEvent.isTrusted) !== null && _a !== void 0 ? _a : false);
2617
2615
  }
2618
2616
 
2619
2617
  return Promise.resolve();
@@ -2645,30 +2643,21 @@ function () {
2645
2643
  }
2646
2644
  };
2647
2645
 
2648
- if (duration === 0) {
2649
- var flicking = getFlickingAttached(this._flicking);
2650
- var camera = flicking.camera;
2651
- animate();
2652
- var newPos = flicking.circularEnabled ? circulatePosition(position, camera.range.min, camera.range.max) : position;
2653
- axes.axisManager.set((_a = {}, _a[POSITION_KEY] = newPos, _a));
2654
- return Promise.resolve();
2655
- } else {
2656
- return new Promise(function (resolve, reject) {
2657
- var animationFinishHandler = function () {
2658
- axes.off(EVENT.HOLD, interruptionHandler);
2659
- resolve();
2660
- };
2646
+ return new Promise(function (resolve, reject) {
2647
+ var animationFinishHandler = function () {
2648
+ axes.off(EVENT.HOLD, interruptionHandler);
2649
+ resolve();
2650
+ };
2661
2651
 
2662
- var interruptionHandler = function () {
2663
- axes.off(EVENT.FINISH, animationFinishHandler);
2664
- reject(new FlickingError(MESSAGE.ANIMATION_INTERRUPTED, CODE.ANIMATION_INTERRUPTED));
2665
- };
2652
+ var interruptionHandler = function () {
2653
+ axes.off(EVENT.FINISH, animationFinishHandler);
2654
+ reject(new FlickingError(MESSAGE.ANIMATION_INTERRUPTED, CODE.ANIMATION_INTERRUPTED));
2655
+ };
2666
2656
 
2667
- axes.once(EVENT.FINISH, animationFinishHandler);
2668
- axes.once(EVENT.HOLD, interruptionHandler);
2669
- animate();
2670
- });
2671
- }
2657
+ axes.once(EVENT.FINISH, animationFinishHandler);
2658
+ axes.once(EVENT.HOLD, interruptionHandler);
2659
+ animate();
2660
+ });
2672
2661
  };
2673
2662
 
2674
2663
  __proto.updateDirection = function () {
@@ -4972,7 +4961,7 @@ function () {
4972
4961
  var el = this._el;
4973
4962
  var flicking = getFlickingAttached(this._flicking);
4974
4963
  var renderer = flicking.renderer;
4975
- if (renderer.rendering) return this;
4964
+ if (renderer.rendering || !flicking.initialized) return this;
4976
4965
  var actualPosition = this._position - this._alignPos - this._offset + this._circularOffset;
4977
4966
  el.style[this._transform] = flicking.horizontal ? "translate(" + -actualPosition + "px)" : "translate(0, " + -actualPosition + "px)";
4978
4967
  return this;
@@ -5683,6 +5672,11 @@ function () {
5683
5672
  });
5684
5673
  };
5685
5674
 
5675
+ __proto._afterRender = function () {
5676
+ var flicking = getFlickingAttached(this._flicking);
5677
+ flicking.camera.applyTransform();
5678
+ };
5679
+
5686
5680
  return Renderer;
5687
5681
  }();
5688
5682
 
@@ -5713,6 +5707,8 @@ function (_super) {
5713
5707
 
5714
5708
  this._resetPanelElementOrder();
5715
5709
 
5710
+ this._afterRender();
5711
+
5716
5712
  return [2
5717
5713
  /*return*/
5718
5714
  ];
@@ -8057,14 +8053,13 @@ function (_super) {
8057
8053
  }
8058
8054
 
8059
8055
  renderer.checkPanelContentsReady(renderer.panels);
8056
+ this._initialized = true;
8060
8057
  return renderer.render().then(function () {
8061
8058
  // Done initializing & emit ready event
8062
8059
  _this._plugins.forEach(function (plugin) {
8063
8060
  return plugin.init(_this);
8064
8061
  });
8065
8062
 
8066
- _this._initialized = true;
8067
-
8068
8063
  if (preventEventsBeforeInit) {
8069
8064
  _this.trigger = originalTrigger;
8070
8065
  }
@@ -8839,7 +8834,7 @@ function (_super) {
8839
8834
  */
8840
8835
 
8841
8836
 
8842
- Flicking.VERSION = "4.10.5";
8837
+ Flicking.VERSION = "4.10.6";
8843
8838
  return Flicking;
8844
8839
  }(Component);
8845
8840