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 #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 from 5cfbf89 to d34cf52 Compare January 30, 2024 16:33
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 d34cf52 to d56ec0a Compare February 2, 2024 14:43
@seanpdoyle
Copy link
Contributor Author

@afcapel could you review this?

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

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.

None yet

1 participant