angular-summernote
angular-summernote copied to clipboard
defer initialization
Is there a way to defer initialization of Summernote using this? I want to initialize it when the user clicks something, and right now as soon as
Interesting requirement. I will think about that.
I'd also like this see this feature! I'm going to set up some sort of work around in the meantime
This will be interesting. I wonder if this will improve the initial load time. I noticed that when I call summernote multiple times inside a form's ng-repeat through a custom directive, it does take a long time to initialize it.
I ended up writing a semi custom wrapper as the inability to defer loading killed this plugin for me (comment tree, nested replies). I suppose that using an ng-if on the summernote element where you flip the boolean on click would work the same though?
@tjsail33 Was it taking too long for this plugin to load for you too? When I tested in Firefox, the page takes more than 30 seconds to load when I have this directive in that form. Without the summernote directive, it loads in 1-2 sec. Were you facing a similar issue? Is that why you are trying to defer the plugin loading?
Yes. Especially when i had close to 30 instances of it on a page that all tried to load at once. I don't think the plugin is inefficient - I just think it needs a way to defer initialization in some way to handle use cases where more than one editor exists in the DOM at once.
Thanks for confirming that. My situation is similar. I have a form with multiple instances of this editor. When I have more than as little as 2-3 itself, the page pretty much crashes due to long initialization time. For now, I am considering to just use a plain textarea as a temporary solution. I agree, the plugin is not inefficient. Its a very good plugin but unfortunately its close to unworkable when there is a need for multiple instances in 1 page. Hoping there could be a solution for this.
@tjsail33 @Mr-Anonymous Do you know other directives has defer initialization or snippets to defer initialization? If so, it is very helpful to resolve this issue. For now, I have no idea about a way how to handle defer initilalization.
i think that a good way to do this would be a boolean initialization variable. I use it in my custom implementation, and tear down the editor when the boolean is false, initialize it when the boolean is true.
@tjsail33 So, did you expose the variable as attibute like <sumernote defer="true">
?
I did <cu-summernote initialized="variable.editable">
.