Skip to content

Commit

Permalink
Use a different method of avoiding reinitialization of the editor
Browse files Browse the repository at this point in the history
  • Loading branch information
matthiask committed Nov 30, 2024
1 parent d8d4293 commit ba13447
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion django_prose_editor/static/django_prose_editor/init.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion src/init.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@ window.__proseEditor = JSON.parse(document.currentScript.dataset.config)
const marker = "data-django-prose-editor"

function createEditor(textarea) {
if (textarea.closest(".prose-editor")) return

const config = JSON.parse(textarea.getAttribute(marker))
textarea.removeAttribute(marker)

const {
Document,
Expand Down

0 comments on commit ba13447

Please sign in to comment.