Skip to content

Commit

Permalink
Merge pull request #24073 from kurund/formbuilder-icon-fixes
Browse files Browse the repository at this point in the history
Afform - show icon on button only if icon is selected
  • Loading branch information
colemanw authored Jul 28, 2022
2 parents 1e7f222 + 974cbc7 commit b3e9cdd
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions ang/crmUi.js
Original file line number Diff line number Diff line change
Expand Up @@ -952,12 +952,15 @@
// handled in crmUiTab ctrl
return;
}
if (attrs.crmIcon.substring(0,3) == 'fa-') {
$(element).prepend('<i class="crm-i ' + attrs.crmIcon + '" aria-hidden="true"></i> ');
}
else {
$(element).prepend('<span class="icon ui-icon-' + attrs.crmIcon + '"></span> ');
if (attrs.crmIcon) {
if (attrs.crmIcon.substring(0,3) == 'fa-') {
$(element).prepend('<i class="crm-i ' + attrs.crmIcon + '" aria-hidden="true"></i> ');
}
else {
$(element).prepend('<span class="icon ui-icon-' + attrs.crmIcon + '"></span> ');
}
}

// Add crm-* class to non-bootstrap buttons
if ($(element).is('button:not(.btn)')) {
$(element).addClass('crm-button');
Expand Down

0 comments on commit b3e9cdd

Please sign in to comment.