开发者

tinymce text editor doesn't load in facebox modal window

开发者 https://www.devze.com 2023-01-27 12:05 出处:网络
I\'m trying to use tinymce editor with facebox modal window. But tinymce doesn\'t load when the modal window is opened and I get no errors of Jscript in firebug

I'm trying to use tinymce editor with facebox modal window. But tinymce doesn't load when the modal window is opened and I get no errors of Jscript in firebug

<script type="text/javascript">

 jQuery(document).ready(function($) {
     $('a[rel*=facebox]').facebox();
 })

 tinyMCE.init({ 
    theme : "advanced", 
    mode : "textareas", 
    plugins : "pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,inlinepopups,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template,advlist", 
    // Theme options
        theme_advanced_buttons1 : "save,newdocument,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,styleselect,formatselect,fontselect,fontsizeselect",
        theme_advanced_buttons2 : "cut,copy,paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code,|,insertdate,inserttime,preview,|,forecolor,backcolor",
        theme_advanced_buttons3 : "tablecontrols,|,hr,removeformat,visualaid,|,sub,sup,|,charmap,emotions,iespell,media,advhr,|,print,|,ltr,rtl,|,fullscreen",
        theme_advanced_buttons4 : "insertlayer,moveforward,movebackward,absolute,|,styleprops,|,cite,abbr,acronym,del,ins,attribs,|,visualchars,nonbreaking,template,pagebreak",
   开发者_如何学Go     theme_advanced_toolbar_location : "top",
        theme_advanced_toolbar_align : "left",
        theme_advanced_resizing : true

});
</script>

any help?


Now I'm working on another project and I had the same issue again

This time I used colorbox and put this code onComplete event of fancybox.

 $(".edit").colorbox({
    onComplete : function(){ tinyMCE.execCommand('mceAddControl', true, "textare_id"); },
    onClosed   : function(){ tinyMCE.execCommand('mceRemoveControl', true, "textare_id");}  
 });

and It worked thanks to gutch for his answer on TinyMCE - undefined 'e','j','t' when loading for a second time in fancyboxm

P.S. Tinymce init function defined in the index file of whole project

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号