MDL-40759 icons: Refactor to allow theme icon systems
[moodle.git] / lib / amd / build / icon_system_fontawesome.min.js
1 define(["core/icon_system","jquery","core/ajax","core/mustache","core/localstorage"],function(a,b,c,d,e){var f=null,g=null,h=function(){a.apply(this,arguments)};return h.prototype=Object.create(a.prototype),h.prototype.init=function(){if(f)return b.when(this);var a=e.get("core/iconmap-fontawesome");return a&&(a=JSON.parse(a)),a?(f=a,b.when(this)):(null===g&&(g=c.call([{methodname:"core_output_load_fontawesome_icon_map",args:[]}],!0,!1)[0]),g.then(function(a){return f={},b.each(a,function(a,b){f[b.component+"/"+b.pix]=b.to}.bind(this)),e.set("core/iconmap-fontawesome",JSON.stringify(f)),this}.bind(this)))},h.prototype.renderIcon=function(a,b,c,e){var g=f[b+"/"+a];"undefined"==typeof g&&(g=b+"/"+a);var h={key:g,title:c};return d.render(e,h)},h.prototype.getTemplateName=function(){return"core/pix_icon_fontawesome"},h});