Commit 555d8984 authored by ι™ˆεΈ…'s avatar ι™ˆεΈ…

fix #2193 width modification needs to trigger resize

parent 1137783b
......@@ -33,6 +33,7 @@ const updateTheme = primaryColor => {
}, 200);
}
if (!lessNodesAppended) {
// insert less.js and color.less
const lessStyleNode = document.createElement('link');
const lessConfigNode = document.createElement('script');
const lessScriptNode = document.createElement('script');
......@@ -106,10 +107,13 @@ export default {
urlParams.searchParams.set(key, value);
}
});
const { primaryColor, colorWeak } = payload;
const { primaryColor, colorWeak, contentWidth } = payload;
if (state.primaryColor !== primaryColor) {
updateTheme(primaryColor);
}
if (state.contentWidth !== contentWidth) {
window.dispatchEvent ? window.dispatchEvent(new Event('resize')) : null;
}
updateColorWeak(colorWeak);
window.history.replaceState(null, 'setting', urlParams.href);
return {
......
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