Skip to content
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

Merged
merged 1 commit into from
Dec 16, 2024
Merged

Width config #540

merged 1 commit into from
Dec 16, 2024

Conversation

paulpestov
Copy link
Collaborator

Test with appending "width" config options to each panel config item. Check the README updates for how to configure.

Closes #368

@paulpestov paulpestov self-assigned this Dec 6, 2024
@paulpestov paulpestov changed the base branch from main to develop December 6, 2024 11:21
…nd overflow horizontally, update mobile panel design to be full width

const onResize = (callback) => {
resizeSubscribers.add(callback);
return () => resizeSubscribers.delete(callback); // Return an unsubscribe function
Copy link
Contributor

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..

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

@orlinmalkja orlinmalkja Dec 13, 2024

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 ?

Copy link
Collaborator Author

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;
Copy link
Contributor

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.

Copy link
Collaborator Author

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.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes true

@paulpestov paulpestov merged commit 22e5160 into develop Dec 16, 2024
2 checks passed
@paulpestov paulpestov deleted the width-config branch December 16, 2024 10:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Enable configuration of relative panel width (resizable panels)
2 participants