Skip to content

Commit

Permalink
fix quill not mounting to modals
Browse files Browse the repository at this point in the history
  • Loading branch information
MaddyUnderStars committed Oct 11, 2024
1 parent e571459 commit 870a70d
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
8 changes: 5 additions & 3 deletions system/templates/base/package-lock.json

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

1 change: 1 addition & 0 deletions system/templates/base/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
"codemirror": "^6.0.1",
"jquery": "^3.7.1",
"quill": "^2.0.2",
"sortablejs": "^1.15.3",
"tom-select": "^2.2.2",
"typescript": "^4.9.5",
"vue": "^2.7.14",
Expand Down
4 changes: 2 additions & 2 deletions system/templates/base/src/js/components/QuillEditor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@ export class QuillEditor {

static bindQuillEditor()
{
const quillEditors = document.querySelectorAll(QuillEditor.quillTarget);
const quillEditors: NodeListOf<HTMLElement> = document.querySelectorAll(QuillEditor.quillTarget);

if (quillEditors) {
quillEditors.forEach((q) => {
if (q.classList.contains(QuillEditor.quillExistsTarget)) return;

const options = q.getAttribute('data-quill-options');
let editor = new Quill('#' + q.id, JSON.parse(options));
let editor = new Quill(q, JSON.parse(options));

const textarea = document.getElementById(q.id.substring(6));
q.closest('form').removeEventListener('submit', () => textarea.innerText = q.querySelector('.ql-editor').innerHTML);
Expand Down

0 comments on commit 870a70d

Please sign in to comment.