diff options
Diffstat (limited to 'web/app/view/edit/DevicesController.js')
-rw-r--r-- | web/app/view/edit/DevicesController.js | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/web/app/view/edit/DevicesController.js b/web/app/view/edit/DevicesController.js index 2b4ff14f..16e54b21 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(); } }, |