cms/app-client/app/routes/tabs/thematiques.js
changeset 337 2ea18460d5e3
parent 299 2c16302b06f7
child 338 4a3899b6a7ed
equal deleted inserted replaced
336:f076ddd29e13 337:2ea18460d5e3
    27     setupController: function(controller) {
    27     setupController: function(controller) {
    28         this._super(...arguments);
    28         this._super(...arguments);
    29         controller.set('themes', this.get('themes'));
    29         controller.set('themes', this.get('themes'));
    30     },
    30     },
    31 
    31 
       
    32     deactivate: function () {
       
    33         this.set('themes', []);
       
    34     },
       
    35 
    32     actions: {
    36     actions: {
    33 
    37 
    34         setIndexQueryparams: function() {
    38         setIndexQueryparams: function() {
    35             this.set('index', this.get('index') + 1);
    39             this.set('index', this.get('index') + 1);
    36         },
    40         },
    37 
    41 
    38         setSortQueryparams: function(sort) {
    42         setSortQueryparams: function(sort) {
    39             this.set('sort', sort);
    43             this.set('sort', sort);
    40             this.get('themes').replaceContent(0, this.get('themes').get('content').length, null);
    44             this.get('themes').get('content').clear();
    41             // Force property reset to trigger request.
    45             if(this.get('index') === 0) {
    42             this.propertyWillChange('index');
    46                 // Force property reset to trigger request
    43             this.set('index', 0);
    47                 this.propertyWillChange('index');
    44             this.propertyDidChange('index');            
    48                 this.set('index', 0);
       
    49                 this.propertyDidChange('index');
       
    50             } else {
       
    51                 this.set('index', 0);
       
    52             }
    45         }
    53         }
    46         
    54         
    47     }
    55     }
    48 
    56 
    49 });
    57 });