Commit 2fc0cb9f authored by afc163's avatar afc163

Add delay for resize

parent 17feda3a
......@@ -44,6 +44,9 @@ class BasicLayout extends React.PureComponent {
type: 'user/fetchCurrent',
});
}
componentWillUnmount() {
clearTimeout(this.resizeTimeout);
}
onCollapse = (collapsed) => {
this.props.dispatch({
type: 'global/changeLayoutCollapsed',
......@@ -170,9 +173,11 @@ class BasicLayout extends React.PureComponent {
type: 'global/changeLayoutCollapsed',
payload: !collapsed,
});
this.resizeTimeout = setTimeout(() => {
const event = document.createEvent('HTMLEvents');
event.initEvent('resize', true, false);
window.dispatchEvent(event);
}, 600);
}
handleNoticeClear = (type) => {
message.success(`ζΈ…η©ΊδΊ†${type}`);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment