mirror of
https://github.com/flarum/framework.git
synced 2025-01-07 19:13:37 +08:00
31 lines
847 B
JavaScript
31 lines
847 B
JavaScript
|
import Ember from 'ember';
|
||
|
|
||
|
import Menu from '../utils/menu';
|
||
|
|
||
|
export default Ember.Component.extend({
|
||
|
items: [],
|
||
|
layoutName: 'components/dropdown-select',
|
||
|
classNames: ['dropdown', 'dropdown-select', 'btn-group'],
|
||
|
classNameBindings: ['itemCountClass'],
|
||
|
|
||
|
buttonClass: 'btn-default',
|
||
|
menuClass: 'pull-right',
|
||
|
icon: 'ellipsis-v',
|
||
|
|
||
|
mainButtonClass: function() {
|
||
|
return 'btn '+this.get('buttonClass');
|
||
|
}.property('buttonClass'),
|
||
|
|
||
|
dropdownMenuClass: function() {
|
||
|
return 'dropdown-menu '+this.get('menuClass');
|
||
|
}.property('menuClass'),
|
||
|
|
||
|
itemCountClass: function() {
|
||
|
return 'item-count-'+this.get('items.length');
|
||
|
}.property('items.length'),
|
||
|
|
||
|
currentItem: function() {
|
||
|
return this.get('menu.childViews').findBy('active');
|
||
|
}.property('menu.childViews.@each.active')
|
||
|
});
|