Closed gfunch closed 2 years ago
Hi, try:
class Post(models.Model):
body_custom = EditorJsJSONField(
plugins=[
"editorjs-tooltip",
],
tools={
"Tooltip": {
"class": "Tooltip",
"config": {
"holder": "id_body_custom_editorjs_holder", # id_{name_field}_editorjs_holder
"location": 'left',
"highlightColor": '#FFEFD5',
"underline": True,
"backgroundColor": '#154360',
"textColor": '#FDFEFE',
}
},
....
you don't need to add js files to the project. Everything is loaded from npm))
Thank you very much! I'll give that a try.
Thank you very much! I'll give that a try.
Hi, did you manage to make it work? Configuration above mentioned by @2ik doesn't seem to work for me. I'm not adding any js files localy to the project.
Edit:
I'm sorry, I specified wrong holder
parameter. It works flawlessly. Thanks!
Hi, I am interested in using
editorjs-tooltip
(https://github.com/kommitters/editorjs-tooltip) as a plugin indjango-editorjs-fields
my application, but am having difficulties including it.Since the plugin does not appear to be supported via cdn, I downloaded the plugin and added the
js
file in thedist
directory to the same directory asdjango-editorjs-fields.js
. I then appended the file viajs_list.append('django-editorjs-fields/js/editorjs-tooltip.js')
. Unfortunately, this did not enable the plugin.Any advice would be appreciated.