jodit
jodit copied to clipboard
Question: add a button to the image toolbar ?
Hi, how can i add a button to the image toolbar ?
Use https://xdsoft.net/jodit/doc/options/popup/ option
Jodit.make('#editor', {
popup: {
img: [
{
name: 'yourbtn',
...
}
]
}
})
Hello,
thank you for the hint!
It could add the new button but it replaces the first button: jodit_toolbar_btn-delete
Please note that i´m working with v 3.3.24 (waiting for #473 fix)
My config: var editor = new Jodit('#content', { inline: true, toolbar: false, toolbarInline: true, popup: { img: [{ name: 'inlineUpload', iconURL: 'http://.../icon-upload.png', label: 'inlineUpload', tooltip: "Inline upload", exec: function (editor) { myFunc(); } } ], selection: [ ...
I was able to find a workaround: popup: { img: [ { name: "delete" }, { name: "pencil" }, { name: "valign" }, { name: "left" }, { ... custom buttons
Use Jodit.defaultOptions.popup.img
and Jodit.Array
for this
img: Jodit.Array([
{ name: "delete" },
...Jodit.defaultOptions.popup.img
])
When you use the usual array - it merges them.
Jodit.Array
will replace the old option.
How can one implement this in Jodit react, through the config? I cant find Jodit.Array() , or Jodit.defaultOptions.popup.img..