• Hello!

    I have an issue with the new wpLink. The previous version (the modal window, as opposed to the new modal box) was working perfectly with the following code.

    So, I have code here and there to open a Bootstrap modal window, in which I have a form, several fields, and a RTE/TinyMCE.
    Previous to the new wpLink, I could insert a link in that modal-ed editor, but not anymore, the new modal box just doesn’t show.
    On click on the Link icon, the placeholder (_wp_link_placeholder) gets added to the MCE correctly, but no modal showing up.

    My form is loaded via a Backbone template, populated with the values on the modal opening, then the editor is added. It all works great, except for the new wpLink that broke with 4.5.

    The textarea from the template:

    <textarea class=form-control name=description id=_description>{{ data.values.description }}</textarea>

    In my JS, on opening of the Bootstrap modal:

    var options = $.extend( {},
      tinyMCEPreInit.mceInit.content,
      {
        selector: '#_description'
      }
    );
    tinyMCE.init( options );

    I already read somewhere that the modal-open class that Bootstrap adds to the body blocks the wpLink somehow. But I got rid of the class on the opening of the modal, before MCE init, and still …

Viewing 1 replies (of 1 total)
  • I recently had a similar issue when I was trying to attach the editor to image metaboxes in the media gallery. The solution for me was a combination of removing the modal-open before the tinymce init, ensuring that the proper plugins were loaded (wordpress along with wplink specifically), and most importantly bumping up the z-index on the inline caption editor which was popping up correctly after that but being hidden behind the modal media dialog box.

Viewing 1 replies (of 1 total)
  • The topic ‘TinyMCE with wpLink in modal window’ is closed to new replies.