One instance of tinyMCE, moved between multiple text-areas?
jquery, tinymce
Solution
In the document ready event, you can do the call to getScript. That will pull the tinyMCE bits into memory. Then in the DIV click events, you can initialize the tinyMCE on demand.
$(function() {
$.getScript('/js/tiny_mce/jquery.tinymce.js');
$('DIV').click(function() {
$(this).tinymce({ // initialization stuff });
});
});
Problem
Using tinyMCE jquery version. I have a content page where there could be many pieces of text which are clickable. So when a user clicks on one of these elements, we want to replace the DIV with the text with a tinyMCE instance containing the text. So originally, I had it calling ``` $.getScript('/js/tiny_mce/jquery.tinymce.js', function() { $(dummyTextarea).tinymce({ ...tinyMCE initialise stuff }) ``` and that was on the onclick of the div. But that of course is very clunky, as it will do an ajax request etc. and get tinymce again and again each time something is clicked. So instead, I want to initialise one tinyMCE instance on page load, and then onclick, just set the active textarea to be my already loaded tinyMCE instance. I can't seem to figure out how to do that with the jquery tinymce version. Is this possible? Any suggestions?