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

Add a element DOM id class #2373

Merged
merged 1 commit into from
Sep 7, 2022
Merged

Conversation

tvdeyen
Copy link
Member

@tvdeyen tvdeyen commented Sep 4, 2022

What is this pull request for?

By default it uses the elements name and its position on the page.
If the element is nested in a parent element it prefixes the id with the parent elements dom_id.

Register your own dom id class with

Alchemy::Element.dom_id_class = MyDomIdClass

Checklist

  • I have followed Pull Request guidelines
  • I have added a detailed description into each commit message
  • I have added tests to cover this change

By default it uses the elements name and its position on the page.
If the element is nested in a parent element it prefixes the id with the parent elements `dom_id`.

Register your own dom id class with

```rb
Alchemy::Element.dom_id_class = MyDomIdClass
```
@tvdeyen tvdeyen requested a review from a team September 4, 2022 16:16
Copy link
Contributor

@mamhoff mamhoff left a comment

Choose a reason for hiding this comment

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

This is nice; I'm wondering whether it's actually truely needed though... :)

@tvdeyen tvdeyen merged commit be7a642 into AlchemyCMS:main Sep 7, 2022
@tvdeyen tvdeyen deleted the add-dom-id-class branch September 7, 2022 12:46
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.

2 participants