@@ -14,28 +14,32 @@ You should have received a copy of the GNU General Public License
1414along with this program. If not, see <http://www.gnu.org/licenses/>.
1515*/
1616
17- import Ember from 'ember' ;
17+ import { isNone } from '@ember/utils' ;
18+
19+ import { computed } from '@ember/object' ;
20+ import { inject as service } from '@ember/service' ;
21+ import Controller , { inject as controller } from '@ember/controller' ;
1822import electronUtils from 'wsd-core/utils/electron' ;
1923
20- export default Ember . Controller . extend ( {
24+ export default Controller . extend ( {
2125 queryParams : {
2226 drilldownInfoParam : 'dd' ,
2327 metricTimelinesParam : 'tl' ,
2428 timeFrom : 'f' ,
2529 timeTo : 't' ,
2630 } ,
2731
28- application : Ember . inject . controller ( 'application' ) ,
29- captureTimelines : Ember . inject . service ( 'capture-timelines' ) ,
32+ application : controller ( 'application' ) ,
33+ captureTimelines : service ( 'capture-timelines' ) ,
3034
3135 selectedViewId : null ,
3236
3337 filter : null ,
3438
3539 drilldownInfoParam : null ,
3640 metricTimelinesParam : null ,
37- timeWindow : Ember . computed ( 'model.queryParams.timeFrom' , 'model.queryParams.timeTo' , function ( ) {
38- if ( Ember . isNone ( this . get ( 'model.queryParams.timeFrom' ) ) === false && Ember . isNone ( this . get ( 'model.queryParams.timeTo' ) ) === false ) {
41+ timeWindow : computed ( 'model.queryParams.timeFrom' , 'model.queryParams.timeTo' , function ( ) {
42+ if ( isNone ( this . get ( 'model.queryParams.timeFrom' ) ) === false && isNone ( this . get ( 'model.queryParams.timeTo' ) ) === false ) {
3943 return {
4044 from : this . get ( 'model.queryParams.timeFrom' ) ,
4145 to : this . get ( 'model.queryParams.timeTo' ) ,
@@ -48,12 +52,12 @@ export default Ember.Controller.extend({
4852 actions : {
4953 openFileBrowser ( ) {
5054 if ( electronUtils . isElectron ( ) ) {
51- this . get ( ' application' ) . send ( 'openFileBrowser' ) ;
55+ this . application . send ( 'openFileBrowser' ) ;
5256 }
5357 } ,
5458
5559 openFile ( value ) {
56- this . get ( ' application' ) . send ( 'openFile' , value ) ;
60+ this . application . send ( 'openFile' , value ) ;
5761 } ,
5862 } ,
5963} ) ;
0 commit comments