angular-ui / ui-tinymce

AngularUI wrapper for TinyMCE
MIT License
488 stars 370 forks source link

Keeping TinyMCE loaded between view changes #162

Open kawazoe opened 9 years ago

kawazoe commented 9 years ago

I am currently trying to integrate TinyMCE in a CMS type of project and I would like to know if there is a way to prevent the editor from reloading every time the view is displayed. While it isn't necessary slow (less than 1 second), it does cause a fairly heavy flicker when loading the page.

I looked into the Angular $templatecache service but, while I could cache the editor's structure once it is loaded, I do not know how I could rebind the various javascript functions to the element on page reload. I am pretty sure TinyMCE does not support to be initialized on a pre-loaded html template.

My only other idea is to have an "editor pool" always running off the screen and simply initialize and move them as I need inside my view through CSS or DOM manipulation. Though, I haven't tested to see if TinyMCE would play well with this.

I am willing to take the time to add this feature as a pull-request, but I would like a second opinion about those two solutions. Any idea? How would you tackle this issue?

deeg commented 9 years ago

I also see a flicker, even when dynamically adding a text area to the page.

I am going to take a look into it and mull over your two solutions and post back soon with my opinion. I hope to get this fixed soon, and maybe into the next release.

raczynskil commented 8 years ago

+1

mcblum commented 8 years ago

+1. We build a drag and drop tree editor and when you have 5-10 of these editors on one page, it takes ~10 seconds to load.