diff options
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); } }, |