};
IconSystemFontawesome.prototype = Object.create(IconSystem.prototype);
+ /**
+ * Prefetch resources so later calls to renderIcon can be resolved synchronously.
+ *
+ * @method init
+ * @return Promise
+ */
IconSystemFontawesome.prototype.init = function() {
if (staticMap) {
- return $.when();
+ return $.when(this);
}
var map = LocalStorage.get('core/iconmap-fontawesome');
if (map) {
staticMap = map;
- return $.when();
+ return $.when(this);
}
if (fetchMap === null) {
fetchMap = Ajax.call([{
- methodname: 'core_output_load_icon_map',
- args: { 'system': 'fontawesome' }
+ methodname: 'core_output_load_fontawesome_icon_map',
+ args: []
}], true, false)[0];
}
staticMap[value.component + '/' + value.pix] = value.to;
}.bind(this));
LocalStorage.set('core/iconmap-fontawesome', JSON.stringify(staticMap));
+ return this;
}.bind(this));
};
return Mustache.render(template, context);
};
+ /**
+ * Get the name of the template to pre-cache for this icon system.
+ *
+ * @return {String}
+ * @method getTemplateName
+ */
+ IconSystemFontawesome.prototype.getTemplateName = function() {
+ return 'core/pix_icon_fontawesome';
+ };
+
return /** @alias module:core/icon_system_fontawesome */ IconSystemFontawesome;
});