Dolphiq / craft3-iconpicker

Craft plugin that provides a new field type that offers end users an easy way to pick an icon from a .woff or .ttf font file. You can easily use ionicons or font awesome icons or any other compatible font file.
MIT License
16 stars 11 forks source link

Fix issue with iconpicker not working in a matrix field #12

Closed glitchedmob closed 5 years ago

glitchedmob commented 5 years ago

This PR fixes #7 and #11

As of right now this code does work, although I don't know a lot about Garnish (mainly because there isn't much in terms of documentation), so there could definitely be some better ways to approach this. I'm open to suggestions.

Another thing I'll mention is that src/views/main/_field.php is written with raw PHP. From what i've seen in the Craft codebase it's better to use twig for this. It could potentially clean up that file and allow us to add that script tag using Craft's {% js %} template tag.