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

Link: Allow to optionally enable modal view #198

Merged
merged 1 commit into from
Sep 8, 2023
Merged

Link: Allow to optionally enable modal view #198

merged 1 commit into from
Sep 8, 2023

Conversation

yhabteab
Copy link
Member

@yhabteab yhabteab commented Sep 6, 2023

No description provided.

@cla-bot cla-bot bot added the cla/signed label Sep 6, 2023
@yhabteab yhabteab added the enhancement New feature or request label Sep 6, 2023
@yhabteab yhabteab self-assigned this Sep 6, 2023
@yhabteab yhabteab added this to the v0.9.0 milestone Sep 6, 2023
@yhabteab yhabteab changed the title Introduce trait ModalOpener Introduce class ModalOpener Sep 6, 2023
Copy link
Member

@nilmerg nilmerg left a comment

Choose a reason for hiding this comment

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

I'd rather create a trait and use that in the Link class. The trait allows the user to optionally make the link a modal opener and since Link is the base for ActionLink and ButtonLink the same applies to them.

The reason for this is, that the javascript implementation for modals expect the opener to be an anchor with a href attribute. A plain button wouldn't work as href isn't a valid attribute for it.

So the only way to not have a link act as opener, but a button, is stylewise, and that's what ButtonLink is for.

The trait should have a public method openInModal(): self and applies the appropriate attributes there.

@yhabteab yhabteab changed the title Introduce class ModalOpener Link: Allow to optionally enable modal view Sep 8, 2023
src/Widget/Link.php Outdated Show resolved Hide resolved
@nilmerg nilmerg merged commit 2b4c168 into main Sep 8, 2023
12 checks passed
@nilmerg nilmerg deleted the modal-opener branch September 8, 2023 13:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla/signed enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants