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

Suggestion: allow the custom action icon to be a function #213

Open
meduzapat opened this issue Apr 12, 2021 · 1 comment
Open

Suggestion: allow the custom action icon to be a function #213

meduzapat opened this issue Apr 12, 2021 · 1 comment

Comments

@meduzapat
Copy link

Amazing work !
Just a little suggestion:
action.icon<string| function> (optional if overwriting, required if custom action)
If the icon element is a string or is null do the normal way, but if is a function use the return string as element

that way we can create custom buttons, like a color picker
I am doing this right now:

{
    icon: '<input type="color" class="pell-button" onchange="document.execCommand(\'backColor\', false, this.value);"/>',
    title: 'Change Background Color',
    result: () => true
},

this works fine but is a nasty workaround (input inside button).

@jaredreich
Copy link
Owner

Ah, very interesting and a good idea. Thanks @meduzapat

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

No branches or pull requests

2 participants