1 import Ember from 'ember'; |
1 import Ember from 'ember'; |
|
2 import _ from 'lodash/lodash'; |
2 |
3 |
3 export default Ember.Route.extend({ |
4 export default Ember.Route.extend({ |
4 |
5 |
5 constants: Ember.inject.service(), |
6 constants: Ember.inject.service(), |
6 player: Ember.inject.service(), |
7 player: Ember.inject.service(), |
|
8 filter: Ember.inject.service(), |
7 |
9 |
8 modelQueryParam: '', |
10 modelQueryParam: '', |
9 |
11 |
10 init: function() { |
12 init: function() { |
11 this._super(...arguments); |
13 this._super(...arguments); |
12 |
14 |
13 this.set('modelQueryParam', this.get('constants').GEONAMES['world']); |
15 this.set('modelQueryParam', this.get('constants').GEONAMES['world']); |
14 }, |
16 }, |
15 |
17 |
16 model: function() { |
18 model: function() { |
17 return this.store.query('geostat', { |
19 var filterQueryParams = _.clone(this.get('filter').get('queryParamsValues')); |
|
20 return this.store.query('geostat', _.merge(filterQueryParams, { |
18 'area': this.get('modelQueryParam'), |
21 'area': this.get('modelQueryParam'), |
19 'details': 1 |
22 'details': 1 |
20 }); |
23 })); |
21 }, |
24 }, |
22 |
25 |
23 activate: function() { |
26 activate: function() { |
24 this.get('player').set('window', false); |
27 this.get('player').set('window', false); |
25 }, |
28 }, |