aboutsummaryrefslogtreecommitdiff
path: root/web/app/view
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
parent5418af40f15876c5c48ffdeec7797f171ae36018 (diff)
downloadtrackermap-web-d1182973f4a029aafdafb7331cc1ea4e264706e6.tar.gz
trackermap-web-d1182973f4a029aafdafb7331cc1ea4e264706e6.tar.bz2
trackermap-web-d1182973f4a029aafdafb7331cc1ea4e264706e6.zip
Move follow button to Map
Diffstat (limited to 'web/app/view')
-rw-r--r--web/app/view/Devices.js7
-rw-r--r--web/app/view/DevicesController.js10
-rw-r--r--web/app/view/Map.js7
-rw-r--r--web/app/view/MapController.js8
4 files changed, 12 insertions, 20 deletions
diff --git a/web/app/view/Devices.js b/web/app/view/Devices.js
index 1789a119..519826e2 100644
--- a/web/app/view/Devices.js
+++ b/web/app/view/Devices.js
@@ -84,13 +84,6 @@ Ext.define('Traccar.view.Devices', {
glyph: 'xf093@FontAwesome',
tooltip: Strings.deviceCommand,
tooltipType: 'title'
- }, {
- id: 'deviceFollowButton',
- glyph: 'xf05b@FontAwesome',
- tooltip: Strings.deviceFollow,
- tooltipType: 'title',
- enableToggle: true,
- toggleHandler: 'onFollowClick'
}]
},
diff --git a/web/app/view/DevicesController.js b/web/app/view/DevicesController.js
index a31ceb77..f09950b3 100644
--- a/web/app/view/DevicesController.js
+++ b/web/app/view/DevicesController.js
@@ -120,16 +120,6 @@ Ext.define('Traccar.view.DevicesController', {
dialog.show();
},
- onFollowClick: function (button, pressed) {
- var device;
- if (pressed) {
- device = this.getView().getSelectionModel().getSelection()[0];
- if (device) {
- this.fireEvent('selectdevice', device, true);
- }
- }
- },
-
updateButtons: function (selected) {
var empty = selected.getCount() === 0;
this.lookupReference('toolbarEditButton').setDisabled(empty);
diff --git a/web/app/view/Map.js b/web/app/view/Map.js
index ce1c1227..be17b889 100644
--- a/web/app/view/Map.js
+++ b/web/app/view/Map.js
@@ -59,6 +59,13 @@ Ext.define('Traccar.view.Map', {
enableToggle: true,
tooltip: Strings.mapLiveRoutes
}, {
+ reference: 'deviceFollowButton',
+ glyph: 'xf05b@FontAwesome',
+ tooltip: Strings.deviceFollow,
+ tooltipType: 'title',
+ enableToggle: true,
+ toggleHandler: 'onFollowClick'
+ }, {
id: 'muteButton',
glyph: 'xf1f7@FontAwesome',
tooltip: Strings.sharedMute,
diff --git a/web/app/view/MapController.js b/web/app/view/MapController.js
index 01cf7f46..ba72171d 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());
}
},