jQuery(document).ready(function($) {
/**
* Meta: TinyMCE
*/
function RunTinyMCE() {
$('.customEditor textarea').each(function(i) {
//Apply TinyMCE to everyone except the one to copy
if(!$(this).parents('div.wpa_group').hasClass('tocopy')) {
var id = $(this).attr('id');
if (!id) {
id = 'customEditor-' + i;
$(this).attr('id', id);
}
tinyMCE.execCommand('mceAddControl', false, id);
}
});
}
RunTinyMCE(); //run onload
$.wpalchemy.bind('wpa_copy', function(the_clone) { //run when copy is made
RunTinyMCE();
});
});