@egjs/flicking
Advanced tools
Comparing version 4.11.5-beta.0 to 4.11.5-beta.1
@@ -12,2 +12,3 @@ import Flicking from "../Flicking"; | ||
disable(): this; | ||
observe(element: Element): this; | ||
private _onResize; | ||
@@ -14,0 +15,0 @@ private _doScheduledResize; |
{ | ||
"name": "@egjs/flicking", | ||
"version": "4.11.5-beta.0", | ||
"version": "4.11.5-beta.1", | ||
"description": "Everyday 30 million people experience. It's reliable, flexible and extendable carousel.", | ||
@@ -5,0 +5,0 @@ "main": "dist/flicking.cjs.js", |
@@ -7,2 +7,6 @@ /* | ||
/** | ||
* A component that detects size change and trigger resize method when the autoResize option is used | ||
* @ko autoResize 옵션을 사용할 때 크기 변화를 감지하고 Flicking의 resize를 호출하는 컴포넌트 | ||
*/ | ||
class AutoResizer { | ||
@@ -42,5 +46,5 @@ private _flicking: Flicking; | ||
flicking.viewport.element, | ||
...(flicking.camera.element ? [flicking.camera.element] : []), | ||
...flicking.panels.map(panel => panel.element), | ||
].forEach((element) => { resizeObserver.observe(element) }); | ||
flicking.camera.element, | ||
...flicking.panels.map(panel => panel.element) | ||
].forEach((element) => { resizeObserver.observe(element); }); | ||
@@ -73,2 +77,9 @@ this._resizeObserver = resizeObserver; | ||
public observe(element: Element): this { | ||
if (this._resizeObserver) { | ||
this._resizeObserver.observe(element); | ||
} | ||
return this; | ||
} | ||
private _onResize = () => { | ||
@@ -78,2 +89,3 @@ const flicking = this._flicking; | ||
const maxResizeDebounce = flicking.maxResizeDebounce; | ||
if (resizeDebounce <= 0) { | ||
@@ -80,0 +92,0 @@ void flicking.resize(); |
@@ -338,4 +338,6 @@ /* | ||
if (flicking.autoResize) { | ||
flicking.autoResizer.enable(); | ||
if (flicking.autoResize && flicking.useResizeObserver) { | ||
panelsAdded.forEach((panel) => { | ||
flicking.autoResizer.observe(panel.element); | ||
}); | ||
} | ||
@@ -342,0 +344,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
5082142
47880