Revision 47eca5c5 snf-cyclades-app/synnefo/ui/new_ui/ui/javascripts/ember/routes/vms.js

b/snf-cyclades-app/synnefo/ui/new_ui/ui/javascripts/ember/routes/vms.js
1 1
App.VmsRoute = Ember.Route.extend({
2 2
    
3 3
    model: function(params){
4
      	this.set( 'viewCls', params.view_cls );
5
      	var controller = this.get("controller");
4
          this.set( 'viewCls', params.view_cls );
5
          var controller = this.get("controller");
6 6

  
7
      	// Ember checks if controller is already set, and if so, does not set it
8
      	// up again. Hence, the following hack:
9
      	if (controller) {
10
      		controller.set("viewCls", params.view_cls);
11
      	}
7
          // Ember checks if controller is already set, and if so, does not set it
8
          // up again. Hence, the following hack:
9
          if (controller) {
10
              controller.set("viewCls", params.view_cls);
11
          }
12 12

  
13
      	// end of hack
14
      	return this.store.find('vm');
13
          // end of hack
14
          return this.store.find('vm');
15 15
    },
16 16
    renderTemplate: function() {
17 17
        this.render('items');
18 18
    },
19 19
   
20 20
    setupController: function(controller, model) {
21
   		controller.set('model', model);
22
   		controller.set("viewCls", this.get("viewCls"));
21
           controller.set('model', model);
22
           controller.set("viewCls", this.get("viewCls"));
23 23
      controller.set('modelName', 'vm');
24
   	},
24
       },
25 25

  
26 26
});

Also available in: Unified diff