aboutsummaryrefslogtreecommitdiff
path: root/web/app
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 /web/app
parent0affb8110de3c53942c85a220babc859e2a7727d (diff)
downloadtrackermap-server-97e80ec49fddec3d56880bae47bd070474fa8fa3.tar.gz
trackermap-server-97e80ec49fddec3d56880bae47bd070474fa8fa3.tar.bz2
trackermap-server-97e80ec49fddec3d56880bae47bd070474fa8fa3.zip
- Remove field container
- Renamed functions and strings
Diffstat (limited to 'web/app')
-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
4 files changed, 48 insertions, 47 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'