diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2016-07-09 13:26:33 +1200 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2016-07-09 13:26:33 +1200 |
commit | fe7b8bd58e23e289a041bc7c9a5d6c37f085419a (patch) | |
tree | d28b58d1ea3b4fcd6c715c4f2d2e2e04cb91c208 /web/app/view/DevicesController.js | |
parent | 70d22de4205aec294660378f0d854cbc32c7a6b8 (diff) | |
download | trackermap-server-fe7b8bd58e23e289a041bc7c9a5d6c37f085419a.tar.gz trackermap-server-fe7b8bd58e23e289a041bc7c9a5d6c37f085419a.tar.bz2 trackermap-server-fe7b8bd58e23e289a041bc7c9a5d6c37f085419a.zip |
Fix issues in JavaScript code
Diffstat (limited to 'web/app/view/DevicesController.js')
-rw-r--r-- | web/app/view/DevicesController.js | 10 |
1 files changed, 6 insertions, 4 deletions
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); } }, |