root / snf-cyclades-app / synnefo / ui / new_ui / ui / javascripts / ember / controllers / item.js @ a6c6857c
History | View | Annotate | Download (774 Bytes)
1 |
App.ItemsItemController = Ember.ObjectController.extend({ |
---|---|
2 |
|
3 |
codeName: 'vm', |
4 |
|
5 |
needs: function() { |
6 |
|
7 |
var needs = [];
|
8 |
/*
|
9 |
App.Vm.eachRelationship(function(name, meta) {
|
10 |
if (meta.kind == 'hasMany') {
|
11 |
needs.push(name);
|
12 |
}
|
13 |
});*/
|
14 |
needs.push(this.codeName+'s'); |
15 |
return needs;
|
16 |
|
17 |
}.property(), |
18 |
|
19 |
hasViewCls: true, |
20 |
|
21 |
// i would like to get it from parent controller ????
|
22 |
icon: function () { |
23 |
var item = this.codeName; |
24 |
return 'snf-'+item+'-full'; |
25 |
}.property(), |
26 |
|
27 |
hasTags: true, |
28 |
|
29 |
codeNameParent: function() { |
30 |
return this.codeName+'s'; |
31 |
}.property(), |
32 |
|
33 |
codeNameChildInit: function() { |
34 |
return this.codeName+'init'; |
35 |
}.property(), |
36 |
|
37 |
|
38 |
|
39 |
}); |