Statistics
| Branch: | Tag: | Revision:

root / snf-cyclades-app / synnefo / ui / new_ui / ui / javascripts / ember / routes / volumes.js @ 86e9ef86

History | View | Annotate | Download (771 Bytes)

1
App.VolumesRoute = Ember.Route.extend({
2
    
3
    model: function(params){
4
          this.set( 'viewCls', params.view_cls );
5
          var controller = this.get("controller");
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
          }
12

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

    
26
});