Skip to content

Commit

Permalink
Merge pull request #84 from howdu/patch-1
Browse files Browse the repository at this point in the history
Add hook for removing tinymce instance
  • Loading branch information
mohamedsabil83 committed Jul 28, 2023
2 parents faf3bf4 + ae3a9f7 commit 032be72
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions resources/dist/js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@ document.addEventListener('DOMContentLoaded', function () {
'filament-forms-repeater-component',
];

Livewire.hook('element.removed', (el, component) => {
if (el && el.getAttribute('x-ref') === 'tinymce') {
tinymce.execCommand('mceRemoveEditor', false, el.id)
window.tinySettingsCopy = window.tinySettingsCopy.filter(tinySetting => tinySetting.id !== el.id);
}
});

Livewire.hook('element.updated', (el) => {
if (!window.tinySettingsCopy) {
return;
Expand Down

0 comments on commit 032be72

Please # to comment.