aboutsummaryrefslogtreecommitdiff
path: root/web/app/view/edit/DevicesController.js
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2020-03-22 22:58:18 -0700
committerAnton Tananaev <anton.tananaev@gmail.com>2020-03-22 22:58:18 -0700
commitba9cc86f667486a09edb323402c2d63ada5ea639 (patch)
tree8df80eca54f9dd39664f63365ffcc2ec248fb3df /web/app/view/edit/DevicesController.js
parent990d485a21c945e7d57b85378650a65f3e79eed3 (diff)
parentf5165c8e897e8d9cf4219d943e2d34b61adb48b5 (diff)
downloadetbsa-traccar-web-ba9cc86f667486a09edb323402c2d63ada5ea639.tar.gz
etbsa-traccar-web-ba9cc86f667486a09edb323402c2d63ada5ea639.tar.bz2
etbsa-traccar-web-ba9cc86f667486a09edb323402c2d63ada5ea639.zip
Merge branch 'master' into modern
Diffstat (limited to 'web/app/view/edit/DevicesController.js')
-rw-r--r--web/app/view/edit/DevicesController.js17
1 files changed, 8 insertions, 9 deletions
diff --git a/web/app/view/edit/DevicesController.js b/web/app/view/edit/DevicesController.js
index 2b4ff14..16e54b2 100644
--- a/web/app/view/edit/DevicesController.js
+++ b/web/app/view/edit/DevicesController.js
@@ -35,7 +35,8 @@ Ext.define('Traccar.view.edit.DevicesController', {
listen: {
controller: {
'*': {
- selectreport: 'selectReport'
+ selectreport: 'deselectDevice',
+ selectevent: 'deselectDevice'
},
'root': {
selectdevice: 'selectDevice'
@@ -109,12 +110,10 @@ Ext.define('Traccar.view.edit.DevicesController', {
this.lookupReference('deviceCommandButton').setDisabled(empty || readonly);
},
- onSelectionChange: function (selection, selected) {
- this.updateButtons(selected);
- if (selected.length > 0) {
- this.fireEvent('selectdevice', selected[0], true);
- } else {
- this.fireEvent('deselectfeature');
+ onSelectionChange: function (el, records) {
+ if (records && records.length) {
+ this.updateButtons(records);
+ this.fireEvent('selectdevice', records[0], true);
}
},
@@ -124,8 +123,8 @@ Ext.define('Traccar.view.edit.DevicesController', {
this.getView().getView().focusRow(device);
},
- selectReport: function (position) {
- if (position !== undefined) {
+ deselectDevice: function (object) {
+ if (object) {
this.deselectFeature();
}
},