diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2017-01-31 17:06:07 +1300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-01-31 17:06:07 +1300 |
commit | 962c40e2127f9c9a7687e4ccb7a6d4a33ac203f7 (patch) | |
tree | 20aa53bbe7d9bb08391e97afdaf1210afd2e4077 /web/app/view/BasePermissionsController.js | |
parent | d1dd9f84e819d70154861ac2487f902da12885ed (diff) | |
parent | da14c04199fe22e6c8bdc02edb2fba7a7ab96a4c (diff) | |
download | trackermap-web-962c40e2127f9c9a7687e4ccb7a6d4a33ac203f7.tar.gz trackermap-web-962c40e2127f9c9a7687e4ccb7a6d4a33ac203f7.tar.bz2 trackermap-web-962c40e2127f9c9a7687e4ccb7a6d4a33ac203f7.zip |
Merge pull request #394 from Abyss777/toolbar_controller
Implement base controller for windows with EditToolbar
Diffstat (limited to 'web/app/view/BasePermissionsController.js')
-rw-r--r-- | web/app/view/BasePermissionsController.js | 6 |
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); } } |