Commit 3a41ffaf authored by Frank Bessou's avatar Frank Bessou 🕸

fix: don't use jquery to load EditorJS

parent f4fb35a3c4dc
......@@ -25,10 +25,10 @@ function loadScript(scriptUrl) {
}
function initEditorjs() {
jQuery("textarea").each((_index, node) => {
Array.from(document.getElementsByTagName("textarea")).forEach((node, index) => {
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 @@ function initEditorjs() {
}
});
}
jQuery(document).ready(() =>
window.addEventListener("DOMContentLoaded", () => {
loadScript(
"https://cdn.jsdelivr.net/npm/@editorjs/editorjs@latest"
).then(() =>
......@@ -78,4 +78,5 @@ jQuery(document).ready(() =>
)
).then(initEditorjs)
)
}
);
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment