From 1e816a4665701b7c0a07eaa3f8343a1234166876 Mon Sep 17 00:00:00 2001 From: Gábor Somogyi Date: Fri, 22 Apr 2016 01:04:57 +0200 Subject: Follow button now jump immediately to device --- web/app/view/Devices.js | 3 ++- web/app/view/DevicesController.js | 7 +++++++ 2 files changed, 9 insertions(+), 1 deletion(-) (limited to 'web') diff --git a/web/app/view/Devices.js b/web/app/view/Devices.js index 4131ba6f9..f06c2658b 100644 --- a/web/app/view/Devices.js +++ b/web/app/view/Devices.js @@ -54,7 +54,8 @@ Ext.define('Traccar.view.Devices', { glyph: 'xf05b@FontAwesome', tooltip: Strings.deviceFollow, tooltipType: 'title', - enableToggle: true + enableToggle: true, + toggleHandler: 'onFollowClick' }, { xtype: 'settingsMenu' }] diff --git a/web/app/view/DevicesController.js b/web/app/view/DevicesController.js index e9a075ffc..135183f97 100644 --- a/web/app/view/DevicesController.js +++ b/web/app/view/DevicesController.js @@ -89,6 +89,13 @@ Ext.define('Traccar.view.DevicesController', { dialog.show(); }, + onFollowClick: function (button, pressed) { + if (pressed) { + var device = this.getView().getSelectionModel().getSelection()[0]; + this.fireEvent('selectDevice', device, true); + } + }, + onSelectionChange: function (selected) { var empty = selected.getCount() === 0; this.lookupReference('toolbarEditButton').setDisabled(empty); -- cgit v1.2.3 From ce97df3033f5ee073a2c21e408fb3d2326a759f9 Mon Sep 17 00:00:00 2001 From: Gábor Somogyi Date: Fri, 22 Apr 2016 01:26:18 +0200 Subject: Whitespace fix --- web/app/view/DevicesController.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'web') diff --git a/web/app/view/DevicesController.js b/web/app/view/DevicesController.js index 135183f97..10918c13a 100644 --- a/web/app/view/DevicesController.js +++ b/web/app/view/DevicesController.js @@ -91,7 +91,7 @@ Ext.define('Traccar.view.DevicesController', { onFollowClick: function (button, pressed) { if (pressed) { - var device = this.getView().getSelectionModel().getSelection()[0]; + var device = this.getView().getSelectionModel().getSelection()[0]; this.fireEvent('selectDevice', device, true); } }, -- cgit v1.2.3