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'],
|
2015-01-16 14:56:10 +08:00
|
|
|
classNameBindings: ['itemCountClass', 'class'],
|
2015-01-03 19:21:47 +08:00
|
|
|
|
|
|
|
title: 'Controls',
|
|
|
|
icon: 'ellipsis-v',
|
2015-01-16 14:56:10 +08:00
|
|
|
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');
|
2015-01-16 14:56:10 +08:00
|
|
|
}.property('items.length'),
|
|
|
|
|
|
|
|
actions: {
|
|
|
|
buttonClick: function() {
|
|
|
|
this.sendAction('buttonClick');
|
|
|
|
}
|
|
|
|
}
|
2015-01-03 19:21:47 +08:00
|
|
|
});
|