From fe7b8bd58e23e289a041bc7c9a5d6c37f085419a Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Sat, 9 Jul 2016 13:26:33 +1200 Subject: Fix issues in JavaScript code --- web/app/view/DevicesController.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'web/app/view/DevicesController.js') diff --git a/web/app/view/DevicesController.js b/web/app/view/DevicesController.js index cf31dd7bb..c61f8711b 100644 --- a/web/app/view/DevicesController.js +++ b/web/app/view/DevicesController.js @@ -86,15 +86,16 @@ Ext.define('Traccar.view.DevicesController', { }, onGeofencesClick: function () { - var admin = Traccar.app.getUser().get('admin'); - var device = this.getView().getSelectionModel().getSelection()[0]; + var admin, device; + admin = Traccar.app.getUser().get('admin'); + device = this.getView().getSelectionModel().getSelection()[0]; Ext.create('Traccar.view.BaseWindow', { title: Strings.sharedGeofences, items: { xtype: 'deviceGeofencesView', baseObjectName: 'deviceId', linkObjectName: 'geofenceId', - storeName: (admin) ? 'AllGeofences' : 'Geofences', + storeName: admin ? 'AllGeofences' : 'Geofences', urlApi: '/api/devices/geofences', baseObject: device.getData().id } @@ -115,8 +116,9 @@ Ext.define('Traccar.view.DevicesController', { }, onFollowClick: function (button, pressed) { + var device; if (pressed) { - var device = this.getView().getSelectionModel().getSelection()[0]; + device = this.getView().getSelectionModel().getSelection()[0]; this.fireEvent('selectDevice', device, true); } }, -- cgit v1.2.3