theKhorshed / cmb2-fontawesome-icon-picker

Custom field to pick icon from fontawesome icons.
GNU General Public License v2.0
14 stars 2 forks source link

Does not work in group (new entire) #1

Open Berdych opened 8 years ago

Berdych commented 8 years ago

Hi. Tnk you for your wonderful extension. But I would like to use it in group fields like here: 38wis Could you fix this?..

theKhorshed commented 8 years ago

I will fix and update it at weekend. Thanks for letting me know about the issue.

monecchi commented 8 years ago

Hey @theKhorshed. Great work with the icon picker CMB2 custom field! Could you please confirm if the repeatable group issue has been solved? Thanks in advance.

MordiSacks commented 7 years ago

Here is a quick fix add this code in

assets/js/fontawesome-picker-init.js

/**
 * Group fix, by Mordi Sacks
 */
jQuery(document).bind('DOMNodeInserted', function (event) {
    if (jQuery(event.target).find('div.cmb-type-fontawesome-icon').length > 0) {
        jQuery(event.target).find('.fontawesome-icon-select').iconpicker({
            hideOnSelect: true
        });
    }
});
Berdych commented 7 years ago

Thank you very much MordiSacks. Everything works well!