aboutsummaryrefslogtreecommitdiff
path: root/web/app/view/MapController.js
diff options
context:
space:
mode:
authorAbyss777 <abyss@fox5.ru>2016-11-16 17:46:07 +0500
committerAbyss777 <abyss@fox5.ru>2016-11-16 17:46:07 +0500
commitd1182973f4a029aafdafb7331cc1ea4e264706e6 (patch)
treeaa1e07fd469c4e2759156f52bc048315959ff755 /web/app/view/MapController.js
parent5418af40f15876c5c48ffdeec7797f171ae36018 (diff)
downloadetbsa-traccar-web-d1182973f4a029aafdafb7331cc1ea4e264706e6.tar.gz
etbsa-traccar-web-d1182973f4a029aafdafb7331cc1ea4e264706e6.tar.bz2
etbsa-traccar-web-d1182973f4a029aafdafb7331cc1ea4e264706e6.zip
Move follow button to Map
Diffstat (limited to 'web/app/view/MapController.js')
-rw-r--r--web/app/view/MapController.js8
1 files changed, 5 insertions, 3 deletions
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());
}
},