Skip to content

Commit

Permalink
Merge pull request #258 from maximehuran/feature/multiple-editors
Browse files Browse the repository at this point in the history
Empty forms to avoid duplicate ids when multiple editors
  • Loading branch information
maximehuran authored Feb 5, 2025
2 parents 7fddd25 + 48a9cd3 commit 663bc49
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions assets/js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -465,6 +465,7 @@ global.MonsieurBizRichEditorManager = class {
this.form.manager.create(data.code, data.data, data.previewHtml, this.form.position);
this.form.manager.newPanel.close();
this.form.manager.selectionPanel.close();
myForm.innerHTML = '';
}
}
if (this.status !== 200) {
Expand All @@ -479,6 +480,7 @@ global.MonsieurBizRichEditorManager = class {
cancelButton.panel = this.newPanel;
cancelButton.addEventListener('click', function (e) {
e.currentTarget.panel.close();
formElement.innerHTML = '';
});
let saveButton = form.querySelector('.js-uie-save');
saveButton.panel = this.newPanel;
Expand Down Expand Up @@ -533,6 +535,7 @@ global.MonsieurBizRichEditorManager = class {
this.form.uiElement.previewHtml = data.previewHtml;
this.form.manager.write();
this.form.manager.editPanel.close();
myForm.innerHTML = '';
}
}
if (this.status !== 200) {
Expand All @@ -547,6 +550,7 @@ global.MonsieurBizRichEditorManager = class {
cancelButton.panel = this.editPanel;
cancelButton.addEventListener('click', function (e) {
e.currentTarget.panel.close();
formElement.innerHTML = '';
});
let saveButton = form.querySelector('.js-uie-save');
saveButton.panel = this.editPanel;
Expand Down
2 changes: 1 addition & 1 deletion src/Resources/public/js/rich-editor-highlight.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/Resources/public/js/rich-editor.js

Large diffs are not rendered by default.

0 comments on commit 663bc49

Please sign in to comment.