1
0
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:
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

@@ -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')
}
});