From d1182973f4a029aafdafb7331cc1ea4e264706e6 Mon Sep 17 00:00:00 2001 From: Abyss777 Date: Wed, 16 Nov 2016 17:46:07 +0500 Subject: Move follow button to Map --- web/app/view/MapController.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'web/app/view/MapController.js') diff --git a/web/app/view/MapController.js b/web/app/view/MapController.js index 01cf7f4..ba72171 100644 --- a/web/app/view/MapController.js +++ b/web/app/view/MapController.js @@ -114,8 +114,10 @@ Ext.define('Traccar.view.MapController', { } }, - followSelected: function () { - return Ext.getCmp('deviceFollowButton') && Ext.getCmp('deviceFollowButton').pressed; + onFollowClick: function (button, pressed) { + if (pressed && this.selectedMarker) { + this.getView().getMapView().setCenter(this.selectedMarker.getGeometry().getCoordinates()); + } }, showLiveRoutes: function (button) { @@ -168,7 +170,7 @@ Ext.define('Traccar.view.MapController', { } - if (marker === this.selectedMarker && this.followSelected()) { + if (marker === this.selectedMarker && this.lookupReference('deviceFollowButton').pressed) { this.getView().getMapView().setCenter(marker.getGeometry().getCoordinates()); } }, -- cgit v1.2.3