-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Width config #540
Width config #540
Conversation
…nd overflow horizontally, update mobile panel design to be full width
601275b
to
df4aa17
Compare
|
||
const onResize = (callback) => { | ||
resizeSubscribers.add(callback); | ||
return () => resizeSubscribers.delete(callback); // Return an unsubscribe function |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have a question here: When will this delete function be executed ? On a normal resize of the window, it is not executed, only the function definition is returned..
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what I see on top from the above link is 'watch(configStore.config, () => {
updatePanelWidth(isMobile.value)
})'
Is this what you meant ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, its in the PanelWrapper in the onUnount
if (container.value) { | ||
defaultWidth.value = isMobile ? container.value.clientWidth - panelWrapperPadding : container.value.clientWidth / panels.value.filter(({ show }) => !!(show)).length - panelMargin; | ||
} | ||
return 300; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this return statement needed ? I don't see whether it is assigned to some variable.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the container does not exist yet.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes true
Test with appending "width" config options to each panel config item. Check the README updates for how to configure.
Closes #368