diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2017-07-15 19:08:58 +1200 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2017-07-15 19:08:58 +1200 |
commit | 7a0c47e8203f300d193e2291848526f9d63c5a8e (patch) | |
tree | 40567c1e84532ee99ab6aa53cb2fc7d52b279f36 /web/app/view/EventsController.js | |
parent | b4e2d507666121c8219894fb108be43de22e48d0 (diff) | |
download | trackermap-web-7a0c47e8203f300d193e2291848526f9d63c5a8e.tar.gz trackermap-web-7a0c47e8203f300d193e2291848526f9d63c5a8e.tar.bz2 trackermap-web-7a0c47e8203f300d193e2291848526f9d63c5a8e.zip |
Fix more event selection issues
Diffstat (limited to 'web/app/view/EventsController.js')
-rw-r--r-- | web/app/view/EventsController.js | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/web/app/view/EventsController.js b/web/app/view/EventsController.js index d275c2c2..f2fef887 100644 --- a/web/app/view/EventsController.js +++ b/web/app/view/EventsController.js @@ -84,13 +84,15 @@ Ext.define('Traccar.view.EventsController', { }, onSelectionChange: function (selection, selected) { - var event, position; + var event, positionId; event = selected.length > 0 ? selected[0] : null; - if (event && event.get('positionId')) { - position = Ext.getStore('EventPositions').getById(event.get('positionId')); - this.fireEvent('selectevent', position); - } else { - this.fireEvent('selectevent'); + if (event) { + positionId = event.get('positionId'); + if (positionId) { + this.fireEvent('selectevent', Ext.getStore('EventPositions').getById(positionId)); + } else { + this.fireEvent('selectevent'); + } } this.lookupReference('removeEventButton').setDisabled(!event); } |