mirror of
https://github.com/discourse/discourse.git
synced 2024-11-25 09:42:07 +08:00
13 lines
388 B
Plaintext
13 lines
388 B
Plaintext
|
Handlebars.registerHelper('fa-icon', function(icon, options) {
|
||
|
var labelKey;
|
||
|
if (options.hash) { labelKey = options.hash.label; }
|
||
|
|
||
|
var html = "<i class='fa fa-" + icon + "'";
|
||
|
if (labelKey) { html += " aria-hidden='true'"; }
|
||
|
html += "></i>";
|
||
|
if (labelKey) {
|
||
|
html += "<span class='sr-only'>" + I18n.t(labelKey) + "</span>";
|
||
|
}
|
||
|
return new Handlebars.SafeString(html);
|
||
|
});
|