سؤال

guys...

I am trying to use lightview and tinymce together.

While testing simple things, I could'nt to reproduce a call to render tinymce using inline type in lightview.

e.g:

             Lightview.show({
                url: "contentPageArea",
                type: "inline",
                options: {
                    closeButton: false,
                    evalScripts: true,
                    afterUpdate: function (element, position) {
                       console.log("after");
                       tinyMCE.execCommand('mceAddControl', false, 'txtAreaContentPage');
                    }
                }
            });

Thanks in advance for any help.

هل كانت مفيدة؟

المحلول

I've fixed it just using this method:

function removeTinyMCE() {
  tinyMCE.execCommand('mceFocus', false, 'txtAreaContentPage');
  tinyMCE.execCommand('mceRemoveControl', false, 'txtAreaContentPage');
}

and calling before addControl

afterUpdate: function (element, position) {
                removeTinyMCE();
                tinyMCE.execCommand('mceAddControl', false, 'txtAreaContentPage');
            }
مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top