mirror of
https://github.com/flarum/core.git
synced 2025-08-07 00:47:00 +02:00
Working on interface components.
This commit is contained in:
@@ -5,29 +5,10 @@ import MenuItemSeparator from '../components/menu-item-separator';
|
||||
|
||||
export default NamedContainerView.extend({
|
||||
|
||||
tagName: 'ul',
|
||||
|
||||
active: null,
|
||||
|
||||
i: 1,
|
||||
addSeparator: function(index) {
|
||||
var item = MenuItemSeparator;
|
||||
this.addItem('separator'+(this.i++), item, index);
|
||||
},
|
||||
|
||||
activeChanged: function() {
|
||||
var active = this.get('active');
|
||||
if (typeof active != 'array') {
|
||||
active = [active];
|
||||
}
|
||||
|
||||
var namedViews = this.get('namedViews');
|
||||
var view;
|
||||
for (var name in namedViews) {
|
||||
if (namedViews.hasOwnProperty(name) && (view = namedViews.get(name))) {
|
||||
view.set('active', active.indexOf(name) !== -1);
|
||||
}
|
||||
}
|
||||
}.observes('active')
|
||||
}
|
||||
|
||||
});
|
||||
|
Reference in New Issue
Block a user