framework/ember/app/components/ui/controls/action-button.js

24 lines
564 B
JavaScript
Raw Normal View History

2014-12-20 14:26:46 +08:00
import Ember from 'ember';
2015-01-03 19:21:47 +08:00
export default Ember.Component.extend({
2014-12-20 14:26:46 +08:00
title: '',
icon: '',
className: '',
action: null,
divider: false,
2015-01-03 09:56:14 +08:00
active: false,
2014-12-20 14:26:46 +08:00
2015-01-03 19:21:47 +08:00
classNames: ['btn', 'btn-default'],
2014-12-20 14:26:46 +08:00
tagName: 'a',
attributeBindings: ['href'],
classNameBindings: ['className'],
href: '#',
layout: Ember.Handlebars.compile('{{#if icon}}{{fa-icon icon class="fa-fw"}} {{/if}}<span>{{title}}</span>'),
click: function(e) {
e.preventDefault();
// this.sendAction('action');
this.get('action')();
}
2015-01-03 19:21:47 +08:00
});