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 | |
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')
-rw-r--r-- | web/app/view/edit/AttributeAliasesController.js | 6 | ||||
-rw-r--r-- | web/app/view/edit/DevicesController.js | 8 | ||||
-rw-r--r-- | web/app/view/edit/GroupsController.js | 2 | ||||
-rw-r--r-- | web/app/view/edit/ToolbarController.js | 2 |
4 files changed, 9 insertions, 9 deletions
diff --git a/web/app/view/edit/AttributeAliasesController.js b/web/app/view/edit/AttributeAliasesController.js index fc2b57f2..d1beb135 100644 --- a/web/app/view/edit/AttributeAliasesController.js +++ b/web/app/view/edit/AttributeAliasesController.js @@ -53,17 +53,17 @@ Ext.define('Traccar.view.edit.AttributeAliasesController', { dialog.show(); }, - onSelectionChange: function (selected) { + onSelectionChange: function (selection, selected) { var disabled = !this.lookupReference('deviceField').getValue(); this.lookupReference('toolbarAddButton').setDisabled(disabled); - disabled = selected.length === 0 || !this.lookupReference('deviceField').getValue(); + disabled = !selected || selected.length === 0 || !this.lookupReference('deviceField').getValue(); this.lookupReference('toolbarEditButton').setDisabled(disabled); this.lookupReference('toolbarRemoveButton').setDisabled(disabled); }, onDeviceChange: function (combobox, newValue, oldValue) { var manager = Traccar.app.getUser().get('admin') || Traccar.app.getUser().get('userLimit') > 0; - this.onSelectionChange(''); + this.onSelectionChange(); if (newValue !== null) { this.getView().getStore().filter('deviceId', newValue); if (manager && this.getView().getStore().getCount() === 0) { 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'); } diff --git a/web/app/view/edit/GroupsController.js b/web/app/view/edit/GroupsController.js index a170b3e9..34eec8da 100644 --- a/web/app/view/edit/GroupsController.js +++ b/web/app/view/edit/GroupsController.js @@ -83,7 +83,7 @@ Ext.define('Traccar.view.edit.GroupsController', { }).show(); }, - onSelectionChange: function (selected) { + onSelectionChange: function (selection, selected) { var disabled = selected.length > 0; this.lookupReference('toolbarGeofencesButton').setDisabled(disabled); this.lookupReference('toolbarAttributesButton').setDisabled(disabled); diff --git a/web/app/view/edit/ToolbarController.js b/web/app/view/edit/ToolbarController.js index fdbaa7e4..2b2297a9 100644 --- a/web/app/view/edit/ToolbarController.js +++ b/web/app/view/edit/ToolbarController.js @@ -62,7 +62,7 @@ Ext.define('Traccar.view.edit.ToolbarController', { }); }, - onSelectionChange: function (selected) { + onSelectionChange: function (selection, selected) { var disabled = selected.length > 0; this.lookupReference('toolbarEditButton').setDisabled(disabled); this.lookupReference('toolbarRemoveButton').setDisabled(disabled); |