Revision 3342f8ce snf-cyclades-app/synnefo/ui/new_ui/ui/javascripts/okeanos-ember.js

b/snf-cyclades-app/synnefo/ui/new_ui/ui/javascripts/okeanos-ember.js
171 171

  
172 172
Okeanos.ApplicationController = Ember.Controller.extend({
173 173
	updateCurrentPath: function() {
174
		// Okeanos.set('currentPath', this.get('currentPath'))
175
		// console.log('AppController: CurrentPath ->', this.get('currentPath'));
174
		// we need the set because ElemsController gets the value of current path in every transition
175
		Okeanos.set('currentPath', this.get('currentPath'))
176 176
		return this.get('currentPath');
177 177
	}.observes('currentPath'),
178 178
	actions: {
......
193 193

  
194 194

  
195 195
Okeanos.ElemsController = Ember.ArrayController.extend({
196
	// ElementController: 'vm',
197 196
	type: undefined,
198 197
	itemController: function(){
199 198
		var type = this.type;
200
		console.log('type ', type.substring(0, type.length - 1))
201 199
		return type.substring(0, type.length - 1);
202 200
	}.property(),
203 201
	icon: function() {
......
234 232
		return this.actionsList.filter(function(el) {
235 233
			return _.contains(el['snf-components'], self.get('controllers.'+parent).type) &&( _.contains(el['enabled-status'], self.get('model.status')) || _.contains(el['enabled-status'], 'all'));
236 234
		})
237
		// return this.actionsList
238 235
	}.property(),
239 236
	createBtn: false,	
240 237
	actions: {
241 238
		shutdown: function(param) {
242 239
			console.log(this.get('model.status'));
243
			this.set('model.status', 'shutting')
244
			console.log(this.get('model.status'));
245
			// this.set('building')
240
			this.set('model.status', 'shutting');
246 241
		},
247 242
		destroyElement: function(param) {
248 243
			var element = this.get('model');
......
303 298
	}.property('controller.status')
304 299
});
305 300

  
301
Okeanos.ImgWrapView = Ember.View.extend({
302
	template: Ember.TEMPLATES['img-wrap'],
303
	classNames: ['img-wrap'],
304
	icon: function() {
305
		var addNewBtn = this.get('parentView').get('addNewBtn');
306
		console.log('addNewBtn: ' + addNewBtn);
307
		if(addNewBtn)
308
			return this.get('parentView').get('icon');
309
		else
310
			return this.get('parentView').get('controller').get('parentController').get('icon');
311
	}.property()
312
});
313

  
306 314

  
307 315
// to evala ws view gt thelw na kanw diaxeirisi tou interaction tou xristi
308 316
Okeanos.ElementSidebarView = Ember.View.extend({

Also available in: Unified diff