Skip to content
Discussion options

You must be logged in to vote

Yes. I have two solutions you can try.

First is the second method I describe above. Essentially, you make a super trait that contains all the child traits.

Here is an example of an Animation trait. The user is initially presented with a drop down containing a list of possible CSS animations that can be applied to the component. When the user selects an animation, 3 more "traits" show up that allow the user to configure the settings of the animation. These values are saved as style attributes of the component.


        editor.TraitManager.addType('animation', {
            noLabel: true,
            templateInput: `<div class="gjs-custom-trait" data-input></div>`,
            createInput()…

Replies: 3 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by stljeff1
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants