diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2017-07-15 18:01:12 +1200 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2017-07-15 18:01:12 +1200 |
commit | 167dec228bf9227fbf1f9fa4a428b8bb309c5f94 (patch) | |
tree | 10f00593931a426aacf97a08d105f8dafda0b427 /web/app/view/edit/DevicesController.js | |
parent | dab4694bcab525bcc26e6af42aacc45901093dc2 (diff) | |
download | trackermap-web-167dec228bf9227fbf1f9fa4a428b8bb309c5f94.tar.gz trackermap-web-167dec228bf9227fbf1f9fa4a428b8bb309c5f94.tar.bz2 trackermap-web-167dec228bf9227fbf1f9fa4a428b8bb309c5f94.zip |
Improvement to events panel
Diffstat (limited to 'web/app/view/edit/DevicesController.js')
-rw-r--r-- | web/app/view/edit/DevicesController.js | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/web/app/view/edit/DevicesController.js b/web/app/view/edit/DevicesController.js index 0cdf18ac..48c5f5b8 100644 --- a/web/app/view/edit/DevicesController.js +++ b/web/app/view/edit/DevicesController.js @@ -133,7 +133,7 @@ Ext.define('Traccar.view.edit.DevicesController', { var readonly, deviceReadonly, empty; deviceReadonly = Traccar.app.getPreference('deviceReadonly', false) && !Traccar.app.getUser().get('admin'); readonly = Traccar.app.getPreference('readonly', false) && !Traccar.app.getUser().get('admin'); - empty = selected.getCount() === 0; + empty = selected.length === 0; this.lookupReference('toolbarEditButton').setDisabled(empty || readonly || deviceReadonly); this.lookupReference('toolbarRemoveButton').setDisabled(empty || readonly || deviceReadonly); this.lookupReference('toolbarGeofencesButton').setDisabled(empty || readonly); @@ -142,10 +142,10 @@ Ext.define('Traccar.view.edit.DevicesController', { this.lookupReference('deviceCommandButton').setDisabled(empty || readonly); }, - onSelectionChange: function (selected) { + onSelectionChange: function (selection, selected) { this.updateButtons(selected); - if (selected.getCount() > 0) { - this.fireEvent('selectdevice', selected.getLastSelected(), true); + if (selected.length > 0) { + this.fireEvent('selectdevice', selected[0], true); } else { this.fireEvent('deselectfeature'); } |