From d0e5e64dad207d4c645315f8f39cb91fc92c00ce Mon Sep 17 00:00:00 2001 From: colemanw Date: Wed, 31 Jul 2024 18:11:52 -0400 Subject: [PATCH] crmIconPicker: include brands, eliminate duplicates --- js/jquery/jquery.crmIconPicker.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/js/jquery/jquery.crmIconPicker.js b/js/jquery/jquery.crmIconPicker.js index 25a61533c5ec..81f47411951f 100644 --- a/js/jquery/jquery.crmIconPicker.js +++ b/js/jquery/jquery.crmIconPicker.js @@ -11,9 +11,14 @@ loaded = $.Deferred(); CRM.$.get(CRM.config.resourceBase + 'bower_components/font-awesome/css/all.css').done(function(data) { var match, - regex = /\.(fa-[-a-zA-Z0-9]+):{1,2}before {/g; + prev, + regex = /\.(fa-[-a-zA-Z0-9]+):+before\s*\{\s*content:\s*"([^"]+)"/g; while((match = regex.exec(data)) !== null) { - icons.push(match[1]); + // Eliminate duplicates if icon is same as previous class + if (match[2] !== prev) { + icons.push(match[1]); + } + prev = match[2]; } loaded.resolve(); });