aboutsummaryrefslogtreecommitdiff
path: root/web/app/view/edit
diff options
context:
space:
mode:
Diffstat (limited to 'web/app/view/edit')
-rw-r--r--web/app/view/edit/AttributeAliasesController.js6
-rw-r--r--web/app/view/edit/DevicesController.js8
-rw-r--r--web/app/view/edit/GroupsController.js2
-rw-r--r--web/app/view/edit/ToolbarController.js2
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);