mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
Rename {{fa-icon}} to {{d-icon}} so it can be more generic
This commit is contained in:
@@ -0,0 +1,6 @@
|
||||
import { registerUnbound } from 'discourse-common/lib/helpers';
|
||||
import { renderIcon } from 'discourse-common/lib/icon-library';
|
||||
|
||||
registerUnbound('d-icon', function(id, params) {
|
||||
return new Handlebars.SafeString(renderIcon('string', id, params));
|
||||
});
|
||||
@@ -1,10 +1,12 @@
|
||||
import { registerUnbound } from 'discourse-common/lib/helpers';
|
||||
import { renderIcon } from 'discourse-common/lib/icon-library';
|
||||
import deprecated from 'discourse-common/lib/deprecated';
|
||||
|
||||
export function iconHTML(id, params) {
|
||||
return renderIcon('string', id, params);
|
||||
}
|
||||
|
||||
registerUnbound('fa-icon', function(icon, params) {
|
||||
deprecated("Use `{{d-icon}}` instead of `{{fa-icon}}");
|
||||
return new Handlebars.SafeString(iconHTML(icon, params));
|
||||
});
|
||||
|
||||
@@ -29,7 +29,7 @@ export function registerIconRenderer(renderer) {
|
||||
|
||||
// Support for font awesome icons
|
||||
function faClasses(id, params) {
|
||||
let classNames = `fa fa-${id}`;
|
||||
let classNames = `fa fa-${id} d-icon d-icon-${id}`;
|
||||
if (params) {
|
||||
if (params.modifier) { classNames += " fa-" + params.modifier; }
|
||||
if (params['class']) { classNames += ' ' + params['class']; }
|
||||
|
||||
Reference in New Issue
Block a user