cartodb-4.42/lib/assets/javascripts/builder/components/custom-list/custom-list-action-view.js

33 lines
611 B
JavaScript
Raw Normal View History

2024-04-06 13:25:13 +08:00
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();
}
});