This repository has been archived on 2023-03-18. You can view files and clone it, but cannot push or open issues or pull requests.
osr-discourse-src/app/assets/javascripts/discourse/components/d-button.js.es6
2016-10-28 10:13:41 -04:00

28 lines
634 B
JavaScript

import { default as computed } from 'ember-addons/ember-computed-decorators';
export default Ember.Component.extend({
// subclasses need this
layoutName: 'components/d-button',
tagName: 'button',
classNameBindings: [':btn', 'noText'],
attributeBindings: ['disabled', 'translatedTitle:title'],
noText: Ember.computed.empty('translatedLabel'),
@computed("title")
translatedTitle(title) {
if (title) return I18n.t(title);
},
@computed("label")
translatedLabel(label) {
if (label) return I18n.t(label);
},
click() {
this.sendAction("action", this.get("actionParam"));
return false;
}
});