2amigos / yii2-tinymce-widget

TinyMCE WYSIWYG widget for Yii2
http://yiiwheels.com
Other
100 stars 48 forks source link

Work for the first call, but not subsequent call when using modal #39

Open DPineault opened 6 years ago

DPineault commented 6 years ago

The TinyMCE renders properly the first time, but calling the modal window again, it doesn't render at all.

I've seen a few posts about the issue, but never found a complete solution.

I tried calling the init() when the modal is shown from the index view (where the modal is opened from) but it doesn't seem to work?

    $("#modal").on("shown.bs.modal",function(){
        tinymce.init({
            "plugins":["advlist autolink lists link charmap print preview anchor","searchreplace visualblocks code fullscreen","insertdatetime media table contextmenu paste","textcolor"],
            "toolbar":"undo redo | styleselect forecolor backcolor | bold italic underline | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image",
            "selector":"#tickets-details"
        });
    });

Can anyone shed some light on the matter?

Eseperio commented 5 years ago

See #45. The problem is that previous tinymce instance already exists.