Skip to content

Commit 5f1771a

Browse files
committed
Increase the reusability of the updateAttrsDialog
1 parent 1eb1720 commit 5f1771a

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed

CHANGELOG.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@ Next version
1919
``pm.*`` namespace.
2020
- Modified the ``HTML`` extension to prettify the HTML code somewhat.
2121
- Added a new ``Fullscreen`` extension.
22+
- Changed the ``updateAttrsDialog`` to insert the dialog element into the
23+
parent element of the ``EditorView`` DOM element instead of searching for an
24+
element with a ``prose-editor`` class. This makes the function more reusable
25+
for even more exotic customizations of the editor.
2226

2327

2428
0.10 (2024-12-17)

django_prose_editor/static/django_prose_editor/editor.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/utils.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ export const updateAttrsDialog =
8888
]),
8989
])
9090

91-
editor.view.dom.closest(".prose-editor").append(div)
91+
editor.view.dom.parentElement.append(div)
9292
const dialog = div.querySelector("dialog")
9393
const form = div.querySelector("form")
9494

0 commit comments

Comments
 (0)