discourse/app/assets/javascripts/discourse/views/button.js.es6
2014-06-23 12:37:38 -04:00

21 lines
522 B
JavaScript

export default Discourse.View.extend({
tagName: 'button',
classNameBindings: [':btn', ':standard', 'dropDownToggle'],
attributeBindings: ['title', 'data-toggle', 'data-share-url'],
title: function() {
return I18n.t(this.get('helpKey') || this.get('textKey'));
}.property('helpKey'),
text: function() {
return I18n.t(this.get('textKey'));
}.property('textKey'),
render: function(buffer) {
if (this.renderIcon) {
this.renderIcon(buffer);
}
buffer.push(this.get('text'));
}
});