1
0
mirror of https://github.com/flarum/core.git synced 2025-07-31 13:40:20 +02:00

Working on interface components.

This commit is contained in:
Toby Zerner
2015-01-03 12:26:14 +10:30
parent 23424a51c6
commit 9375f605a8
20 changed files with 161 additions and 55 deletions

View File

@@ -0,0 +1,30 @@
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')
});