modxcms / TinyMCE

TinyMCE integration for MODx Revolution.
http://svn.modxcms.com/docs/display/ADDON/TinyMCE
4 stars 10 forks source link

Tiny Will Not Display Content in RTE TVs on Windows Browsers #22

Open jaygilmore opened 7 years ago

jaygilmore commented 7 years ago

There appears to be an issue in https://github.com/modxcms/TinyMCE/blob/develop/assets/components/tinymce/tiny.js that causes the content of the RTE on a RTE TV to not display. The RTE pane just appears blank.

This code replacing the onTVLoad function section seems to solve it:

,onTVLoad: function() {
    if (Tiny.config.plugins.indexOf(',inlinepopups')<0) MODx.loadRTE();
    var els = Ext.query('.modx-richtext');
    var ed;
    Ext.each(els,function(el) {
        el = Ext.get(el);
        if (!el) {return;}
        if (Ext.isEmpty(Tiny.loadedTVs)) {Tiny.loadedTVs = [];}
        if (Tiny.loadedTVs.indexOf(el) != -1) {return;}
        setTimeout(function() {
            tinyMCE.execCommand('mceAddControl', false, el.dom.id)
            ed = tinyMCE.get(el.dom.id);
            if (ed) {
                ed.execCommand('mceResize',false,'60%');
            }
            Tiny.loadedTVs.push(el);
          }, 100);
    },this);
}

This is an issue for all browsers in Windows for some reason.

This issue and fix were reported here: https://github.com/splittingred/TinyMCE/issues/106

Jenzemann commented 7 years ago

Sometimes it also prevents the Ressource from saving. The Code also fixed this Problem for me.