cartodb-4.42/lib/assets/javascripts/builder/components/tab-pane/tab-pane-icon-view.js

29 lines
511 B
JavaScript
Raw Normal View History

2024-04-06 13:25:13 +08:00
var CoreView = require('backbone/core-view');
var Template = require('./tab-pane-icon.tpl');
/**
* Icon component
*/
module.exports = CoreView.extend({
tagName: 'i',
className: 'CDB-IconFont',
initialize: function (options) {
if (!this.model) {
throw new Error('A model should be provided');
}
this.template = this.options.template || Template;
},
render: function () {
this.$el.html(this.template({
icon: this.model.get('icon')
}));
return this;
}
});