Hi Alex
Love trumbowyg, in fact so much that i use it multiple times on several pages 馃槃
But that leads the plugin fetching the icons.svg multiple times, once per textarea, which becomes a render-blocking problem.
as you can see:
I'm Sure there's some clever way around this, or if not, is it something that could be fixed somehow?
Thanks in advance.
Edit:
this is my call:
$('textarea').trumbowyg({
btns: [
['viewHTML'],
['undo', 'redo'],
['formatting'],
['strong', 'em', 'del'],
['link'],
['justifyLeft', 'justifyCenter', 'justifyRight', 'justifyFull'],
['unorderedList', 'orderedList'],
['horizontalRule'],
['removeformat'],
['fullscreen']
]
});
Hey!
Check out the "Use SVG icons without XHR" section here: https://alex-d.github.io/Trumbowyg/documentation/#svg-icons
I think it's the right way for you.
Another way if you want to keep the AJAX thing, is to make the AJAX call yourself once, insert the SVG in your HTML (like Trumbowyg does), then run your code. When the #trumbowyg-icons is in the HTML, Trumbowyg skip the AJAX call since icons are already available.
But I keep that in mind, there is some optimisation to do.
Most helpful comment
Hey!
Check out the "Use SVG icons without XHR" section here: https://alex-d.github.io/Trumbowyg/documentation/#svg-icons
I think it's the right way for you.
Another way if you want to keep the AJAX thing, is to make the AJAX call yourself once, insert the SVG in your HTML (like Trumbowyg does), then run your code. When the
#trumbowyg-iconsis in the HTML, Trumbowyg skip the AJAX call since icons are already available.But I keep that in mind, there is some optimisation to do.