function sortable_start_hook(event, ui){ if(typeof mce_elements != "undefined"){ $(ui.item).find(mce_elements).each(function(i) { tinyMCE.execCommand("mceRemoveControl",true,this.id); }); } } function sortable_stop_hook(event, ui){ if(typeof mce_elements != "undefined"){ $(ui.item).find(mce_elements).each(function(i) { tinyMCE.execCommand("mceAddControl",false,this.id); }); } }