Trumbowyg: Many instances become render-blocking

Created on 6 Dec 2018  路  1Comment  路  Source: Alex-D/Trumbowyg

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:
iconloads

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']
        ]
    });
question

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-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.

>All comments

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.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Ydalb picture Ydalb  路  3Comments

lstrzebinczyk picture lstrzebinczyk  路  4Comments

KiarashS picture KiarashS  路  3Comments

tonvanalebeek picture tonvanalebeek  路  6Comments

dohomi picture dohomi  路  5Comments