work in progress add support for groups

This commit is contained in:
Sam
2013-04-17 17:08:21 +10:00
parent a6170db443
commit 4cea92c4e9
20 changed files with 268 additions and 117 deletions
@@ -0,0 +1,19 @@
// this allows you to track the selected item in an array, ghetto for now
Discourse.SelectableArray = Em.ArrayProxy.extend({
content: [],
selectIndex: function(index){
this.select(this[index]);
},
select: function(selected){
this.content.each(function(item){
if(item === selected){
Em.set(item, "active", true)
} else {
if (item.get("active")) {
Em.set(item, "active", false)
}
}
});
this.set("active", selected);
}
});