@egjs/flicking
Advanced tools
Comparing version 4.10.5 to 4.10.6
@@ -57,3 +57,4 @@ import Flicking, { FlickingOptions } from "../Flicking"; | ||
protected _removePanelElements(panels: Panel[]): void; | ||
protected _afterRender(): void; | ||
} | ||
export default Renderer; |
{ | ||
"name": "@egjs/flicking", | ||
"version": "4.10.5", | ||
"version": "4.10.6", | ||
"description": "Everyday 30 million people experience. It's reliable, flexible and extendable carousel.", | ||
@@ -5,0 +5,0 @@ "main": "dist/flicking.js", |
@@ -554,3 +554,3 @@ /* | ||
if (renderer.rendering) return this; | ||
if (renderer.rendering || !flicking.initialized) return this; | ||
@@ -557,0 +557,0 @@ const actualPosition = this._position - this._alignPos - this._offset + this._circularOffset; |
@@ -11,3 +11,3 @@ /* | ||
import * as ERROR from "../const/error"; | ||
import { circulatePosition, getFlickingAttached, parseBounce } from "../utils"; | ||
import { getFlickingAttached, parseBounce } from "../utils"; | ||
import { ControlParams } from "../type/external"; | ||
@@ -380,33 +380,18 @@ | ||
if (duration === 0) { | ||
const flicking = getFlickingAttached(this._flicking); | ||
const camera = flicking.camera; | ||
return new Promise((resolve, reject) => { | ||
const animationFinishHandler = () => { | ||
axes.off(AXES.EVENT.HOLD, interruptionHandler); | ||
resolve(); | ||
}; | ||
animate(); | ||
const interruptionHandler = () => { | ||
axes.off(AXES.EVENT.FINISH, animationFinishHandler); | ||
reject(new FlickingError(ERROR.MESSAGE.ANIMATION_INTERRUPTED, ERROR.CODE.ANIMATION_INTERRUPTED)); | ||
}; | ||
const newPos = flicking.circularEnabled | ||
? circulatePosition(position, camera.range.min, camera.range.max) | ||
: position; | ||
axes.once(AXES.EVENT.FINISH, animationFinishHandler); | ||
axes.once(AXES.EVENT.HOLD, interruptionHandler); | ||
axes.axisManager.set({ [AXES.POSITION_KEY]: newPos }); | ||
return Promise.resolve(); | ||
} else { | ||
return new Promise((resolve, reject) => { | ||
const animationFinishHandler = () => { | ||
axes.off(AXES.EVENT.HOLD, interruptionHandler); | ||
resolve(); | ||
}; | ||
const interruptionHandler = () => { | ||
axes.off(AXES.EVENT.FINISH, animationFinishHandler); | ||
reject(new FlickingError(ERROR.MESSAGE.ANIMATION_INTERRUPTED, ERROR.CODE.ANIMATION_INTERRUPTED)); | ||
}; | ||
axes.once(AXES.EVENT.FINISH, animationFinishHandler); | ||
axes.once(AXES.EVENT.HOLD, interruptionHandler); | ||
animate(); | ||
}); | ||
} | ||
animate(); | ||
}); | ||
} | ||
@@ -413,0 +398,0 @@ |
@@ -539,4 +539,10 @@ /* | ||
} | ||
protected _afterRender() { | ||
const flicking = getFlickingAttached(this._flicking); | ||
flicking.camera.applyTransform(); | ||
} | ||
} | ||
export default Renderer; |
@@ -23,2 +23,3 @@ /* | ||
this._resetPanelElementOrder(); | ||
this._afterRender(); | ||
} | ||
@@ -25,0 +26,0 @@ |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
4173730
38828