aboutsummaryrefslogtreecommitdiff
path: root/web/DeviceView.js
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2015-04-26 17:34:47 +1200
committerAnton Tananaev <anton.tananaev@gmail.com>2015-04-26 17:34:47 +1200
commit71dad7d3240bb178701e5dd1e86ae31a6eaa8263 (patch)
tree38de4eb7b2f74329fa9b2cc8dc2e05e54ed2faad /web/DeviceView.js
parent8148beb00a82096b1d41f81bd5b3019fa75de2e9 (diff)
downloadtrackermap-server-71dad7d3240bb178701e5dd1e86ae31a6eaa8263.tar.gz
trackermap-server-71dad7d3240bb178701e5dd1e86ae31a6eaa8263.tar.bz2
trackermap-server-71dad7d3240bb178701e5dd1e86ae31a6eaa8263.zip
Implement logout button
Diffstat (limited to 'web/DeviceView.js')
-rw-r--r--web/DeviceView.js40
1 files changed, 21 insertions, 19 deletions
diff --git a/web/DeviceView.js b/web/DeviceView.js
index 09174467c..0e1312e5d 100644
--- a/web/DeviceView.js
+++ b/web/DeviceView.js
@@ -20,25 +20,27 @@ Ext.define('DeviceView', {
title: Strings.device_title,
-
- initComponent: function() {
-
- this.tbar = [{
- text:'Add'
- }, {
- text:'Edit'
- }, {
- text:'Remove'
- }, {
- xtype: 'tbfill'
- }, {
- text:'Settings'
- }, {
- text:'Logout'
- }];
-
- this.callParent();
- },
+ tbar: [{
+ text:'Add'
+ }, {
+ text:'Edit'
+ }, {
+ text:'Remove'
+ }, {
+ xtype: 'tbfill'
+ }, {
+ text:'Settings'
+ }, {
+ text:'Logout',
+ handler: function() {
+ Ext.Ajax.request({
+ url: '/api/logout',
+ success: function() {
+ window.location.reload();
+ }
+ });
+ }
+ }],
store: {
proxy: {