aboutsummaryrefslogtreecommitdiff
path: root/web/app/view/device
diff options
context:
space:
mode:
Diffstat (limited to 'web/app/view/device')
-rw-r--r--web/app/view/device/DeviceController.js9
1 files changed, 6 insertions, 3 deletions
diff --git a/web/app/view/device/DeviceController.js b/web/app/view/device/DeviceController.js
index f45f348b6..158f6c52c 100644
--- a/web/app/view/device/DeviceController.js
+++ b/web/app/view/device/DeviceController.js
@@ -71,9 +71,12 @@ Ext.define('Traccar.view.device.DeviceController', {
},
onSelectionChange: function(selected) {
- var disabled = selected.length > 0;
- this.lookupReference('deviceEditButton').setDisabled(disabled);
- this.lookupReference('deviceRemoveButton').setDisabled(disabled);
+ var empty = selected.getCount() === 0;
+ this.lookupReference('deviceEditButton').setDisabled(empty);
+ this.lookupReference('deviceRemoveButton').setDisabled(empty);
+ if (!empty) {
+ this.fireEvent("selectDevice", selected.getLastSelected());
+ }
},
onUserClick: function() {