Suggestion: allow the custom action icon to be a function
meduzapat opened this issue · 1 comments
meduzapat commented
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 commented
Ah, very interesting and a good idea. Thanks @meduzapat