I have some textareas and all of them are with tinyMCE.
I would like to set the content of the specific textarea, but I can\'t find how.
I have tryed this:>
The following works with tinymce version 4, and doesn't show the editor as a textarea while it's being dragged:
function initializeEditors() {
var editorContent = {};
$("#photo-list").sortable({
start: function (e, ui) {
$('.attachment-info').each(function () {
var id = $(this).attr('id');
editorContent[id] = tinyMCE.get(id).getContent();
});
},
stop: function (e, ui) {
$('.attachment-info').each(function () {
var id = $(this).attr('id');
tinymce.execCommand('mceRemoveEditor', false, id);
tinymce.execCommand('mceAddEditor', true, id);
tinyMCE.get(id).setContent(editorContent[id]);
});
}
});
}