开发者

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

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);}


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");  
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜