This repository has been archived on 2023-03-18. You can view files and clone it, but cannot push or open issues or pull requests.
osr-discourse-src/app/assets/javascripts/discourse/helpers/fa-icon.js.es6
2014-09-09 17:29:05 -04:00

13 lines
388 B
JavaScript

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);
});