-
Notifications
You must be signed in to change notification settings - Fork 399
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
Adding custom action to Formatbar #410
Comments
Sir Trevor uses Scribe to control what happens in the format bar, so you'd be better looking at integrating your action into scribe and then calling it from the commands. |
Like @SgtOddball says all it does at present is sends a command to scribe and isn't customisable per field. There's a PR that is dealing with some of this and I've got some thoughts on that as that's something i've been looking at. What are you trying to do that wouldn't modify the contenteditable block? |
I want to add some tagging functionality to the text. Right now im inserting a span with an uuid on a click on SirTrevor.setBlockOptions SirTrevor.setBlockOptions('CustomText', {
controllable: true,
controls: {
'footnoteHandler': (e) => {
this.InsertUUID( e ); //Call a modal to fill in some data.
e.preventDefault();
},
},
}); This function inserts html into the contenteditable section and opens up a model where i can input some data. |
@AreWeThereYeti he formatbar is not yet customisable per block then you'll be able to achieve this for the moment it's for the complete editor. What i'd suggest is creating a scribe plugin and adding a command which references this plugin. This option would be visible to all the blocks, but because you'd limit the queryEnabled to only a specific block then this would do what you need. Pseudo example:
|
I know it's abit off topic, but considering the recent issues people are having with regards to scribe and it's lack of documentation, would an alternative ever be considered? Only reason I mention this is I came across Quilljs which from what I can tell does pretty much the same job using the content editable. It's also got Feel free to tell me to piss off but it was out of frustration over scribe's limitations rather than anything else. |
@SgtOddball can you add this as a specific issue. It's something we've been discussing and don't want it lost here. |
@raffij Done and done. |
Hello there
Im looking to add some custom actions to the format bar. I dont want to create som custom document.execCommand but just assign an action to a custom field in the formatbar.I havent found anything in the documentation about this being possible but i aim at doing something like below.
Is it possible to add a custom action to the formatbar?
The text was updated successfully, but these errors were encountered: