micc83 / fontIconPicker

🌈 jQuery fontIconPicker v2 is a small (3.22kb gzipped) jQuery plugin which allows you to include a simple icon picker with search and pagination inside your administration forms.
http://micc83.github.io/fontIconPicker/
MIT License
266 stars 86 forks source link

Extract icon markup generator function #39

Closed matiasgarciaisaia closed 6 years ago

matiasgarciaisaia commented 6 years ago

So users can specify their own way of constructing an icon.

This is particularly useful for rendering with Material Icons, as those use the format <i class="material-icons">ICON_CLASS</i> or <i class="material-icons">ICON_CODEPOINT</i>

Users would do something like this in that case:

$('#element').fontIconPicker({ iconGenerator: function(elem) { return '' + elem + ''; } });

(They also can take other settings into account, but this is just a sample)