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

Define TrixToolbarElement.editorElements property #1127

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

seanpdoyle
Copy link
Contributor

Define properties for accessing all <trix-editor> elements that declare a relationship with a <trix-toolbar> element through a [toolbar]-[id] attribute relationship.

Since multiple <trix-editor> elements can reference a <trix-toolbar> element by name, this commit introduces both an .editorElements and .editorElement properties.

The .editorElement property returns the first item in .editorElements, if there are any.

@seanpdoyle seanpdoyle mentioned this pull request Jan 30, 2024
@seanpdoyle seanpdoyle force-pushed the trix-toolbar-editorElement-property branch 2 times, most recently from d34cf52 to d56ec0a Compare February 2, 2024 14:43
@seanpdoyle
Copy link
Contributor Author

seanpdoyle commented Feb 2, 2024

@afcapel could you review this?

I'm imagining a use case where applications might want to set up a trix-initialize event listener that iterates through the editor's <trix-toolbar> elements to mark them as [data-turbo-permanent].

Define properties for accessing all `<trix-editor>` elements that
declare a relationship with a `<trix-toolbar>` element through a
`[toolbar]`-`[id]` attribute relationship.

Since multiple `<trix-editor>` elements can reference a `<trix-toolbar>`
element by name, this commit introduces both an `.editorElements` and
`.editorElement` properties.

The `.editorElement` property returns the first item in
`.editorElements`, if there are any.
@seanpdoyle seanpdoyle force-pushed the trix-toolbar-editorElement-property branch from d56ec0a to 6a86202 Compare September 30, 2024 16:10
@seanpdoyle seanpdoyle changed the title Define TrixToolbarElement.editorElements Define TrixToolbarElement.editorElements property Sep 30, 2024
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.

1 participant