Skip to content

Commit

Permalink
crmIconPicker: include brands, eliminate duplicates
Browse files Browse the repository at this point in the history
  • Loading branch information
colemanw committed Jul 31, 2024
1 parent 83c51eb commit d0e5e64
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions js/jquery/jquery.crmIconPicker.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
});
Expand Down

0 comments on commit d0e5e64

Please sign in to comment.