Revision 3342f8ce snf-cyclades-app/synnefo/ui/new_ui/ui/javascripts/okeanos-ember/ember-all.js
b/snf-cyclades-app/synnefo/ui/new_ui/ui/javascripts/okeanos-ember/ember-all.js | ||
---|---|---|
39 | 39 |
|
40 | 40 |
Okeanos.ApplicationController = Ember.Controller.extend({ |
41 | 41 |
updateCurrentPath: function() { |
42 |
// Okeanos.set('currentPath', this.get('currentPath'))
|
|
43 |
// console.log('AppController: CurrentPath ->', this.get('currentPath'));
|
|
42 |
// we need the set because ElemsController gets the value of current path in every transition
|
|
43 |
Okeanos.set('currentPath', this.get('currentPath'))
|
|
44 | 44 |
return this.get('currentPath'); |
45 | 45 |
}.observes('currentPath'), |
46 | 46 |
actions: { |
... | ... | |
61 | 61 |
|
62 | 62 |
|
63 | 63 |
Okeanos.ElemsController = Ember.ArrayController.extend({ |
64 |
// ElementController: 'vm', |
|
65 | 64 |
type: undefined, |
66 | 65 |
itemController: function(){ |
67 | 66 |
var type = this.type; |
68 |
console.log('type ', type.substring(0, type.length - 1)) |
|
69 | 67 |
return type.substring(0, type.length - 1); |
70 | 68 |
}.property(), |
71 | 69 |
icon: function() { |
... | ... | |
102 | 100 |
return this.actionsList.filter(function(el) { |
103 | 101 |
return _.contains(el['snf-components'], self.get('controllers.'+parent).type) &&( _.contains(el['enabled-status'], self.get('model.status')) || _.contains(el['enabled-status'], 'all')); |
104 | 102 |
}) |
105 |
// return this.actionsList |
|
106 | 103 |
}.property(), |
107 | 104 |
createBtn: false, |
108 | 105 |
actions: { |
109 | 106 |
shutdown: function(param) { |
110 | 107 |
console.log(this.get('model.status')); |
111 |
this.set('model.status', 'shutting') |
|
112 |
console.log(this.get('model.status')); |
|
113 |
// this.set('building') |
|
108 |
this.set('model.status', 'shutting'); |
|
114 | 109 |
}, |
115 | 110 |
destroyElement: function(param) { |
116 | 111 |
var element = this.get('model'); |
... | ... | |
171 | 166 |
}.property('controller.status') |
172 | 167 |
}); |
173 | 168 |
|
169 |
Okeanos.ImgWrapView = Ember.View.extend({ |
|
170 |
template: Ember.TEMPLATES['img-wrap'], |
|
171 |
classNames: ['img-wrap'], |
|
172 |
icon: function() { |
|
173 |
var addNewBtn = this.get('parentView').get('addNewBtn'); |
|
174 |
console.log('addNewBtn: ' + addNewBtn); |
|
175 |
if(addNewBtn) |
|
176 |
return this.get('parentView').get('icon'); |
|
177 |
else |
|
178 |
return this.get('parentView').get('controller').get('parentController').get('icon'); |
|
179 |
}.property() |
|
180 |
}); |
|
181 |
|
|
174 | 182 |
|
175 | 183 |
// to evala ws view gt thelw na kanw diaxeirisi tou interaction tou xristi |
176 | 184 |
Okeanos.ElementSidebarView = Ember.View.extend({ |
Also available in: Unified diff