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

28 lines
709 B
JavaScript
Raw Normal View History

2015-01-03 19:21:47 +08:00
import Ember from 'ember';
export default Ember.Component.extend({
items: null, // TaggedArray
layoutName: 'components/ui/controls/dropdown-button',
classNames: ['dropdown', 'btn-group'],
classNameBindings: ['itemCountClass', 'class'],
2015-01-03 19:21:47 +08:00
label: 'Controls',
2015-01-03 19:21:47 +08:00
icon: 'ellipsis-v',
buttonClass: 'btn btn-default',
menuClass: '',
2015-01-03 19:21:47 +08:00
dropdownMenuClass: function() {
return 'dropdown-menu '+this.get('menuClass');
}.property('menuClass'),
itemCountClass: function() {
return 'item-count-'+this.get('items.length');
}.property('items.length'),
actions: {
buttonClick: function() {
this.sendAction('buttonClick');
}
}
2015-01-03 19:21:47 +08:00
});