0

After I found a solution to resize my tinyMCE instances ( they are readonly ). I faced a problem that I can't solve from hours... When I init the tinyMCE everything is OK, but in Internet Explorer and early versions of Chrome this doesn't work

tinyMCE.init({
        mode: "textareas",
        theme: "advanced",
        readonly: true,
        theme_advanced_path: false,
        theme_advanced_resize_horizontal: false,
        autoresize: true,
        width: "870",
        setup: function(ed) {
            ed.onLoadContent.add(function(ed, o) {
                var iFrameID = "#" + ($(this).attr('id')) + "_ifr";
                $(iFrameID).height($(iFrameID).contents().find("html").height());
                //iFrameID.height = iFrameID.contentWindow.document.body.scrollHeight + "px";
            });
        }
    });

Also my Java Script attempt which is bellow the jQuery also not works. I will be more than happy if anyone got solution for this! Thanks in advance!

cyrat
  • 628
  • 1
  • 11
  • 20

1 Answers1

0

And here is the configuration that worked for me!

 tinyMCE.init({
            mode: "textareas",
            theme: "advanced",
            theme_advanced_path: false,
            theme_advanced_resize_horizontal: false,
            autoresize: true,
            readonly: true,
            width: "870",
            plugins: 'autoresize',
            autoresize_min_height: "200",
            autoresize_max_height: "50000",
            init_instance_callback: function(inst) {
                inst.execCommand('mceAutoResize');
            },
            setup: function(ed) {
                ed.onLoadContent.add(function(ed, o) {
                    var iFrameID = "#" + ($(this).attr('id')) + "_ifr";
                    $(iFrameID).contents().find("html").children().append("<base target=_blank>");

                   //The following row not works in IE - $(iFrameID).height($(iFrameID).contents().find("html").height());
                });
            }
        });
cyrat
  • 628
  • 1
  • 11
  • 20