Prevent from double loading font-awsome

Prevent from double loading font-awsome

by Uchendu Nwachukwu -
Number of replies: 2

Hello,

I'm currently developing a plugin that uses font-awsome to display a bunch of icons. Currently I'm adding the font-awsome like a stylesheet. I'm now wondering if there is a possibility to check if font-awsome is already loaded through another plugin like the font-awsome filter or a theme.

I've already posted this in the blocks forum but it matches better here since it's more a general question. There I've received an interesting approach from Jon regarding this answer from stackoverflow. As far I understand the answer none of the suggestions there is recommended which led me to the conclusion that I've created a checkbox in the global settings where the user can choose to import font-awsome or not.

Are there any suggestions how to do that automatically?

Best regards, Uchendu

Average of ratings: -
In reply to Uchendu Nwachukwu

Re: Prevent from double loading font-awsome

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

Please don't ask the same question in more than one forum. Ask the moderator to move it if in the wrong place wink

Anyway... what about http://stackoverflow.com/questions/38701497/how-to-check-if-font-awesome-is-loaded-in-web-page-with-javascript

In reply to Howard Miller

Re: Prevent from double loading font-awsome

by Uchendu Nwachukwu -

Thank you for reply. Sorry about the double post, it wasn't aware of this possibility.

The solution seems to work fine and is until now the best approach. I'm going to use it and maybe one day there will be a more proper way.