update docs

This commit is contained in:
Harvey Zack committed 2023-05-06 09:52:01 +08:00
1 parent 2749d50209
commit 550aa0e7f2
95 files changed
+1734 -1828

No files matched your search

+9 -8
View File
@@ -1,17 +1,18 @@
import { throttle } from '../utils';
export default function resizeInit(art, events) {
const { option } = art;
const { option, constructor } = art;
const resizeFn = throttle(() => {
if (art.state === 'standard') {
art.autoSize = option.autoSize;
art.on('resize', () => {
const { aspectRatio, notice } = art;
art.aspectRatio = aspectRatio;
if (art.state === 'standard' && option.autoSize) {
art.autoSize();
}
art.aspectRatioReset();
art.notice.show = '';
art.emit('resize');
}, art.constructor.RESIZE_TIME);
notice.show = '';
});
const resizeFn = throttle(() => art.emit('resize'), constructor.RESIZE_TIME);
events.proxy(window, ['orientationchange', 'resize'], () => resizeFn());
if (screen && screen.orientation && screen.orientation.onchange) {
events.proxy(screen.orientation, 'change', () => resizeFn());