TinyMCE - undefined 'e','j','t' when loading for a second time in fancyboxm

╄→гoц情女王★ 提交于 2019-12-11 06:57:29

问题


Morning.

I am currently trying to add a quick edit feature to my application. I have simply data passed using fancybox wich loads the appropriate data into tinymce.

The problem being once i have closed the fancybox down for the first time and move onto the second item to edit and click, everything loads up ok visualy (including tinyMCE) but i cannot edit within the wysiwyg editor with firebug displaying undefined 'e' or 't' or 'd' whichever one it decides to show...

any help would be muchly appreciated.

EDIT

try{
    function remove_mce(){
        tinyMCE.execCommand('mceRemoveControl',false,'elm1');   
    }
    $('#tree a').bind('click', function(){
        $('#tree ul li ul').removeClass('showBranch');
        var ob = $(this);
        var ob_parent = ob.parent('li');
        ob_parent.removeClass('branch').addClass('branch-open');
        ob.parents('ul').addClass('showBranch');
        $('~ li', ob_parent).children(':first').addClass('showBranch');
        return false;
    });
    $("#tree .product a").fancybox({
        'autoDimensions':   false,
        'width'         :   '750',
        'height'        :   '90%',
        'transitionIn'  :   'elastic',
        'transitionOut' :   'elastic',
        'speedIn'       :   600, 
        'speedOut'      :   200, 
        'overlayShow'   :   true,
        'hideOnOverlayClick' : false,
        'onCleanup'     :   remove_mce()
    });
}catch(err){alert(err.message);}

回答1:


TinyMCE will have problems if its controls are removed by something else then reopened, as it seems that fancybox is doing.

If possible you should create the TinyMCE control when the fancybox is opened using this command:

tinyMCE.execCommand('mceAddControl', false, "control id here");

Then when the fancybox is closed also close the TinyMCE control:

tinyMCE.execCommand('mceRemoveControl', false, "control id here");  


来源:https://stackoverflow.com/questions/4457903/tinymce-undefined-e-j-t-when-loading-for-a-second-time-in-fancyboxm

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!