@egjs/flicking
Advanced tools
Comparing version 4.11.5-beta.1 to 4.11.5-beta.2
@@ -15,2 +15,3 @@ import Flicking, { FlickingOptions } from "../Flicking"; | ||
private _transform; | ||
private _lookedOffset; | ||
private _position; | ||
@@ -17,0 +18,0 @@ private _alignPos; |
@@ -12,3 +12,2 @@ import Flicking from "../Flicking"; | ||
disable(): this; | ||
observe(element: Element): this; | ||
private _onResize; | ||
@@ -15,0 +14,0 @@ private _doScheduledResize; |
import Component from "@egjs/component"; | ||
import Viewport from "./core/Viewport"; | ||
import AutoResizer from "./core/AutoResizer"; | ||
import { Panel } from "./core/panel"; | ||
@@ -126,3 +125,2 @@ import VirtualManager, { VirtualOptions } from "./core/VirtualManager"; | ||
get viewport(): Viewport; | ||
get autoResizer(): AutoResizer; | ||
get initialized(): boolean; | ||
@@ -129,0 +127,0 @@ get circularEnabled(): boolean; |
{ | ||
"name": "@egjs/flicking", | ||
"version": "4.11.5-beta.1", | ||
"version": "4.11.5-beta.2", | ||
"description": "Everyday 30 million people experience. It's reliable, flexible and extendable carousel.", | ||
@@ -5,0 +5,0 @@ "main": "dist/flicking.cjs.js", |
@@ -35,2 +35,3 @@ /* | ||
private _transform: string; | ||
private _lookedOffset: number; | ||
private _position: number; | ||
@@ -296,2 +297,4 @@ private _alignPos: number; | ||
public lookAt(pos: number): void { | ||
const prevOffset = this._offset; | ||
const isChangedOffset = this._lookedOffset !== prevOffset; | ||
const flicking = getFlickingAttached(this._flicking); | ||
@@ -306,6 +309,11 @@ const prevPos = this._position; | ||
if (toggled) { | ||
if (isChangedOffset || toggled) { | ||
void flicking.renderer.render().then(() => { | ||
this.updateOffset(); | ||
this._lookedOffset = this._offset; | ||
}); | ||
} else if (isChangedOffset) { | ||
// sync offset for renderOnlyVisible on resize | ||
this.updateOffset(); | ||
this._lookedOffset = this._offset; | ||
} else { | ||
@@ -312,0 +320,0 @@ this.applyTransform(); |
@@ -7,6 +7,2 @@ /* | ||
/** | ||
* A component that detects size change and trigger resize method when the autoResize option is used | ||
* @ko autoResize 옵션을 사용할 때 크기 변화를 감지하고 Flicking의 resize를 호출하는 컴포넌트 | ||
*/ | ||
class AutoResizer { | ||
@@ -44,7 +40,3 @@ private _flicking: Flicking; | ||
[ | ||
flicking.viewport.element, | ||
flicking.camera.element, | ||
...flicking.panels.map(panel => panel.element) | ||
].forEach((element) => { resizeObserver.observe(element); }); | ||
resizeObserver.observe(flicking.viewport.element); | ||
@@ -77,9 +69,2 @@ this._resizeObserver = resizeObserver; | ||
public observe(element: Element): this { | ||
if (this._resizeObserver) { | ||
this._resizeObserver.observe(element); | ||
} | ||
return this; | ||
} | ||
private _onResize = () => { | ||
@@ -86,0 +71,0 @@ const flicking = this._flicking; |
@@ -338,8 +338,2 @@ /* | ||
if (flicking.autoResize && flicking.useResizeObserver) { | ||
panelsAdded.forEach((panel) => { | ||
flicking.autoResizer.observe(panel.element); | ||
}); | ||
} | ||
void this.render(); | ||
@@ -346,0 +340,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
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
5068631
47719