mirror of
https://github.com/flarum/core.git
synced 2025-08-01 14:10:37 +02:00
Working on interface components.
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
import Ember from 'ember';
|
||||
|
||||
import MenuItemContainer from '../components/menu-item-container';
|
||||
|
||||
export default Ember.Component.extend({
|
||||
items: null, // NamedContainerView/Menu
|
||||
layoutName: 'components/dropdown-split',
|
||||
@@ -20,5 +22,19 @@ export default Ember.Component.extend({
|
||||
|
||||
itemCountClass: function() {
|
||||
return 'item-count-'+this.get('items.length');
|
||||
}.property('items')
|
||||
}.property('items'),
|
||||
|
||||
containedItems: function() {
|
||||
var contained = [];
|
||||
this.get('items').forEach(function(item) {
|
||||
if (item.tagName != 'li') {
|
||||
contained.push(MenuItemContainer.extend({
|
||||
item: item
|
||||
}));
|
||||
} else {
|
||||
contained.push(item);
|
||||
}
|
||||
});
|
||||
return contained;
|
||||
}.property('items.[]')
|
||||
});
|
||||
|
Reference in New Issue
Block a user