trix icon indicating copy to clipboard operation
trix copied to clipboard

Multiple configurations per app?

Open brendon opened this issue 6 years ago • 16 comments

I was wondering if there was a way to specify multiple configurations of Trix per application?

In my example, I want to use Trix in a very basic form (only Bold, Italic, etc... available) in one place, but also have the full editor available in another place. Right now I can configure a custom toolbar per editor which hides the extra functions, but this doesn't prevent the extra functions getting triggered should someone paste in applicable text from another application (e.g. I don't want to allow lists, but one can paste in a list even if the list button isn't on the toolbar).

I know I can disable lists globally by editing the Trix.config object but I was wondering if there was a way to have multiple Trix objects, or multiple configurations per the one global?

brendon avatar Sep 15 '19 23:09 brendon

As a workaround you may deactivate all undesirable formatting after paste event has happened.

vpetrushenko avatar Sep 19 '19 08:09 vpetrushenko

Ah righty :) Definitely sounds like quite a workaround :D

brendon avatar Sep 19 '19 21:09 brendon

This issue has been automatically marked as stale after 90 days of inactivity. It will be closed if no further activity occurs.

stale[bot] avatar Dec 18 '19 22:12 stale[bot]

Stayin' alive!

brendon avatar Dec 18 '19 22:12 brendon

This issue has been automatically marked as stale after 90 days of inactivity. It will be closed if no further activity occurs.

stale[bot] avatar Mar 18 '20 02:03 stale[bot]

I think this is still something that would be good to support :)

brendon avatar Mar 18 '20 03:03 brendon

I would love to have something like this as well.

I'm initializing multiple Trix editors on the same page and it would be great to be able to do something like querySelector('trix-editor').editor.config = {...} instead of just having the global config Trix.config which gets applied to all instances.

danielpuglisi avatar Mar 30 '20 13:03 danielpuglisi

This issue has been automatically marked as stale after 90 days of inactivity. It will be closed if no further activity occurs.

stale[bot] avatar Jun 28 '20 14:06 stale[bot]

I still think this would be a good idea at some point :)

brendon avatar Jun 28 '20 21:06 brendon

This issue has been automatically marked as stale after 90 days of inactivity. It will be closed if no further activity occurs.

stale[bot] avatar Sep 27 '20 12:09 stale[bot]

keepalive

brendon avatar Sep 27 '20 23:09 brendon

This would definitely be helpful. Perhaps Trix.config could be used as the default configuration, and a per-instance override feature could be added?

coffeeshopped avatar Nov 12 '20 20:11 coffeeshopped

This issue has been automatically marked as stale after 90 days of inactivity. It will be closed if no further activity occurs.

stale[bot] avatar Mar 11 '21 14:03 stale[bot]

keepalive

ksouthworth avatar Mar 11 '21 15:03 ksouthworth

This would be very helpful for the project I'm currently on. We have the Trix editor in multiple places and require different levels of functionality in some of those places. We're currently hiding some of the formatting buttons using CSS but for the reasons mentioned in this issue it would be cleaner to be able to have multiple configurations. I like the per instance override idea @coffeeshopped alluded to.

jaredplanter avatar Aug 11 '21 15:08 jaredplanter

I get the feeling this won't happen unless someone decides to contribute this feature from the community. Maybe it's only just on the cusp of annoying for most people! :D

brendon avatar Aug 11 '21 20:08 brendon