aboutsummaryrefslogtreecommitdiff
path: root/web/app/view
diff options
context:
space:
mode:
authorAbyss777 <abyss@fox5.ru>2017-01-30 16:42:16 +0500
committerAbyss777 <abyss@fox5.ru>2017-01-30 16:42:16 +0500
commitda14c04199fe22e6c8bdc02edb2fba7a7ab96a4c (patch)
tree20aa53bbe7d9bb08391e97afdaf1210afd2e4077 /web/app/view
parente774dedf3497f640af5a686723a0f5cf0ea42b93 (diff)
downloadtrackermap-web-da14c04199fe22e6c8bdc02edb2fba7a7ab96a4c.tar.gz
trackermap-web-da14c04199fe22e6c8bdc02edb2fba7a7ab96a4c.tar.bz2
trackermap-web-da14c04199fe22e6c8bdc02edb2fba7a7ab96a4c.zip
Reject changes in BasePermissionsController on failure
Diffstat (limited to 'web/app/view')
-rw-r--r--web/app/view/BasePermissionsController.js6
1 files changed, 4 insertions, 2 deletions
diff --git a/web/app/view/BasePermissionsController.js b/web/app/view/BasePermissionsController.js
index e18badcc..2fb2d873 100644
--- a/web/app/view/BasePermissionsController.js
+++ b/web/app/view/BasePermissionsController.js
@@ -47,7 +47,7 @@ Ext.define('Traccar.view.BasePermissionsController', {
});
},
- onBeforeSelect: function (object, record, index) {
+ onBeforeSelect: function (selection, record, index) {
var data = {};
data[this.getView().baseObjectName] = this.getView().baseObject;
data[this.getView().linkObjectName] = record.getId();
@@ -57,13 +57,14 @@ Ext.define('Traccar.view.BasePermissionsController', {
jsonData: Ext.util.JSON.encode(data),
callback: function (options, success, response) {
if (!success) {
+ selection.deselect(record);
Traccar.app.showError(response);
}
}
});
},
- onBeforeDeselect: function (object, record, index) {
+ onBeforeDeselect: function (selection, record, index) {
var data = {};
data[this.getView().baseObjectName] = this.getView().baseObject;
data[this.getView().linkObjectName] = record.getId();
@@ -74,6 +75,7 @@ Ext.define('Traccar.view.BasePermissionsController', {
jsonData: Ext.util.JSON.encode(data),
callback: function (options, success, response) {
if (!success) {
+ selection.select(record);
Traccar.app.showError(response);
}
}