aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAbyss777 <abyss@fox5.ru>2016-09-06 15:58:03 +0500
committerAbyss777 <abyss@fox5.ru>2016-09-06 15:58:03 +0500
commit97e80ec49fddec3d56880bae47bd070474fa8fa3 (patch)
tree79139d5328cba462f385a4876b71b3add6a7f7a2
parent0affb8110de3c53942c85a220babc859e2a7727d (diff)
downloadtrackermap-server-97e80ec49fddec3d56880bae47bd070474fa8fa3.tar.gz
trackermap-server-97e80ec49fddec3d56880bae47bd070474fa8fa3.tar.bz2
trackermap-server-97e80ec49fddec3d56880bae47bd070474fa8fa3.zip
- Remove field container
- Renamed functions and strings
-rw-r--r--web/app/view/MapController.js6
-rw-r--r--web/app/view/ServerDialog.js37
-rw-r--r--web/app/view/ServerDialogController.js15
-rw-r--r--web/app/view/UserDialog.js37
-rw-r--r--web/l10n/en.json2
5 files changed, 49 insertions, 48 deletions
diff --git a/web/app/view/MapController.js b/web/app/view/MapController.js
index 288593dab..c0ac2c534 100644
--- a/web/app/view/MapController.js
+++ b/web/app/view/MapController.js
@@ -24,7 +24,7 @@ Ext.define('Traccar.view.MapController', {
'*': {
selectDevice: 'selectDevice',
selectReport: 'selectReport',
- getMapCenter: 'getMapCenter'
+ mapstaterequest: 'getMapState'
}
},
store: {
@@ -307,11 +307,11 @@ Ext.define('Traccar.view.MapController', {
}
},
- getMapCenter: function () {
+ getMapState: function () {
var zoom, center, projection;
projection = this.getView().getMapView().getProjection();
center = ol.proj.transform(this.getView().getMapView().getCenter(), projection, 'EPSG:4326');
zoom = this.getView().getMapView().getZoom();
- this.fireEvent('setCenterFromMap', center[1], center[0], zoom);
+ this.fireEvent('mapstate', center[1], center[0], zoom);
}
});
diff --git a/web/app/view/ServerDialog.js b/web/app/view/ServerDialog.js
index 83f9c47f2..40afa4ec3 100644
--- a/web/app/view/ServerDialog.js
+++ b/web/app/view/ServerDialog.js
@@ -66,21 +66,22 @@ Ext.define('Traccar.view.ServerDialog', {
displayField: 'name',
valueField: 'key'
}, {
- xtype: 'fieldcontainer',
- reference: 'mapCenter',
- defaultType: 'numberfield',
- items: [{
- name: 'latitude',
- fieldLabel: Strings.positionLatitude,
- decimalPrecision: Traccar.Style.coordinatePrecision
- }, {
- name: 'longitude',
- fieldLabel: Strings.positionLongitude,
- decimalPrecision: Traccar.Style.coordinatePrecision
- }, {
- name: 'zoom',
- fieldLabel: Strings.serverZoom
- }]
+ xtype: 'numberfield',
+ reference: 'latitude',
+ name: 'latitude',
+ fieldLabel: Strings.positionLatitude,
+ decimalPrecision: Traccar.Style.coordinatePrecision
+ }, {
+ xtype: 'numberfield',
+ reference: 'longitude',
+ name: 'longitude',
+ fieldLabel: Strings.positionLongitude,
+ decimalPrecision: Traccar.Style.coordinatePrecision
+ }, {
+ xtype: 'numberfield',
+ reference: 'zoom',
+ name: 'zoom',
+ fieldLabel: Strings.serverZoom
}, {
xtype: 'checkboxfield',
name: 'twelveHourFormat',
@@ -93,10 +94,10 @@ Ext.define('Traccar.view.ServerDialog', {
text: Strings.sharedAttributes,
handler: 'showAttributesView'
}, {
- glyph: 'xf276@FontAwesome',
+ glyph: 'xf041@FontAwesome',
minWidth: 0,
- handler: 'getFromMap',
- tooltip: Strings.sharedGetFromMap,
+ handler: 'getMapState',
+ tooltip: Strings.sharedGetMapState,
tooltipType: 'title'
}, {
xtype: 'tbfill'
diff --git a/web/app/view/ServerDialogController.js b/web/app/view/ServerDialogController.js
index 42760ca58..55f49f676 100644
--- a/web/app/view/ServerDialogController.js
+++ b/web/app/view/ServerDialogController.js
@@ -23,20 +23,19 @@ Ext.define('Traccar.view.ServerDialogController', {
listen: {
controller: {
'*': {
- setCenterFromMap: 'setCenterFromMap'
+ mapstate: 'setMapState'
}
}
}
},
- getFromMap: function (button) {
- this.fireEvent('getMapCenter');
+ getMapState: function (button) {
+ this.fireEvent('mapstaterequest');
},
- setCenterFromMap: function (lat, lon, zoom) {
- var mapCenter = this.lookupReference('mapCenter');
- mapCenter.down('numberfield[name="latitude"]').setValue(lat);
- mapCenter.down('numberfield[name="longitude"]').setValue(lon);
- mapCenter.down('numberfield[name="zoom"]').setValue(zoom);
+ setMapState: function (lat, lon, zoom) {
+ this.getView().lookupReference('latitude').setValue(lat);
+ this.getView().lookupReference('longitude').setValue(lon);
+ this.getView().lookupReference('zoom').setValue(zoom);
}
});
diff --git a/web/app/view/UserDialog.js b/web/app/view/UserDialog.js
index 46b86dd5d..f9e704ee5 100644
--- a/web/app/view/UserDialog.js
+++ b/web/app/view/UserDialog.js
@@ -70,21 +70,22 @@ Ext.define('Traccar.view.UserDialog', {
displayField: 'name',
valueField: 'key'
}, {
- xtype: 'fieldcontainer',
- reference: 'mapCenter',
- defaultType: 'numberfield',
- items: [{
- name: 'latitude',
- fieldLabel: Strings.positionLatitude,
- decimalPrecision: Traccar.Style.coordinatePrecision
- }, {
- name: 'longitude',
- fieldLabel: Strings.positionLongitude,
- decimalPrecision: Traccar.Style.coordinatePrecision
- }, {
- name: 'zoom',
- fieldLabel: Strings.serverZoom
- }]
+ xtype: 'numberfield',
+ reference: 'latitude',
+ name: 'latitude',
+ fieldLabel: Strings.positionLatitude,
+ decimalPrecision: Traccar.Style.coordinatePrecision
+ }, {
+ xtype: 'numberfield',
+ reference: 'longitude',
+ name: 'longitude',
+ fieldLabel: Strings.positionLongitude,
+ decimalPrecision: Traccar.Style.coordinatePrecision
+ }, {
+ xtype: 'numberfield',
+ reference: 'zoom',
+ name: 'zoom',
+ fieldLabel: Strings.serverZoom
}, {
xtype: 'checkboxfield',
name: 'twelveHourFormat',
@@ -97,10 +98,10 @@ Ext.define('Traccar.view.UserDialog', {
text: Strings.sharedAttributes,
handler: 'showAttributesView'
}, {
- glyph: 'xf276@FontAwesome',
+ glyph: 'xf041@FontAwesome',
minWidth: 0,
- handler: 'getFromMap',
- tooltip: Strings.sharedGetFromMap,
+ handler: 'getMapState',
+ tooltip: Strings.sharedGetMapState,
tooltipType: 'title'
}, {
xtype: 'tbfill'
diff --git a/web/l10n/en.json b/web/l10n/en.json
index 88f572e33..e61710523 100644
--- a/web/l10n/en.json
+++ b/web/l10n/en.json
@@ -28,7 +28,7 @@
"sharedDistance": "Distance",
"sharedHourAbbreviation": "h",
"sharedMinuteAbbreviation": "m",
- "sharedGetFromMap": "Get from Map",
+ "sharedGetMapState": "Get Map State",
"errorTitle": "Error",
"errorUnknown": "Unknown error",
"errorConnection": "Connection error",