Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
cubicweb
cubes
editorjs
Commits
3a41ffaf8414
Commit
3a41ffaf
authored
Jun 11, 2021
by
Frank Bessou
🍁
Browse files
fix: don't use jquery to load EditorJS
parent
f4fb35a3c4dc
Changes
1
Hide whitespace changes
Inline
Side-by-side
cubicweb_editorjs/data/cubes.editorjs.js
View file @
3a41ffaf
...
...
@@ -25,6 +25,6 @@
}
function
initEditorjs
()
{
jQuery
(
"
textarea
"
)
.
e
ach
((
_i
nde
x
,
n
o
de
)
=>
{
Array
.
from
(
document
.
getElementsByTagName
(
"
textarea
"
)
).
forE
ach
((
n
o
de
,
i
nde
x
)
=>
{
if
(
node
.
getAttribute
(
"
cubicweb:type
"
)
==
"
editorjs
"
)
{
const
editor
=
document
.
createElement
(
"
div
"
);
...
...
@@ -29,6 +29,6 @@
if
(
node
.
getAttribute
(
"
cubicweb:type
"
)
==
"
editorjs
"
)
{
const
editor
=
document
.
createElement
(
"
div
"
);
$
(
node
).
hide
()
;
node
.
style
.
display
=
"
none
"
;
node
.
parentNode
.
appendChild
(
editor
);
const
editorJsConfig
=
{
/**
...
...
@@ -68,7 +68,7 @@
}
});
}
jQuery
(
document
).
ready
(
()
=>
window
.
addEventListener
(
"
DOMContentLoaded
"
,
()
=>
{
loadScript
(
"
https://cdn.jsdelivr.net/npm/@editorjs/editorjs@latest
"
).
then
(()
=>
...
...
@@ -78,4 +78,5 @@
)
).
then
(
initEditorjs
)
)
}
);
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment