cartodb-4.42/lib/assets/javascripts/builder/components/custom-list/custom-list-action-view.js
2024-04-06 05:25:13 +00:00

33 lines
611 B
JavaScript

var CoreView = require('backbone/core-view');
var template = require('./custom-list-action.tpl');
module.exports = CoreView.extend({
className: 'CDB-Text CDB-Size-small is-semibold u-upperCase u-actionTextColor u-lSpace--xl',
tagName: 'button',
events: {
'click': '_onClick'
},
initialize: function (opts) {
this.options = opts;
},
render: function () {
this.$el.empty();
this.clearSubViews();
this.$el.append(template({
label: this.options.label
}));
return this;
},
_onClick: function () {
this.options.action && this.options.action();
}
});