aboutsummaryrefslogtreecommitdiff
path: root/web/app/view/StateController.js
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2015-11-08 12:38:57 +1300
committerAnton Tananaev <anton.tananaev@gmail.com>2015-11-08 12:38:57 +1300
commitd2f8ca9cb1dae87591de1b5e6037c78c15d23d2a (patch)
tree191c9e7e12ba6a86bc8d9912cc9001e8bc3599e9 /web/app/view/StateController.js
parent0f6b2460a1d63f135731d22f15ecc33ee90bbef5 (diff)
downloadtrackermap-server-d2f8ca9cb1dae87591de1b5e6037c78c15d23d2a.tar.gz
trackermap-server-d2f8ca9cb1dae87591de1b5e6037c78c15d23d2a.tar.bz2
trackermap-server-d2f8ca9cb1dae87591de1b5e6037c78c15d23d2a.zip
Generate priorities for postion keys
Diffstat (limited to 'web/app/view/StateController.js')
-rw-r--r--web/app/view/StateController.js50
1 files changed, 13 insertions, 37 deletions
diff --git a/web/app/view/StateController.js b/web/app/view/StateController.js
index 98adb6b11..e2b80643d 100644
--- a/web/app/view/StateController.js
+++ b/web/app/view/StateController.js
@@ -35,44 +35,20 @@ Ext.define('Traccar.view.StateController', {
}
},
- keys: {
- fixTime: {
- priority: 1,
- name: Strings.positionTime
- },
- latitude: {
- priority: 2,
- name: Strings.positionLatitude
- },
- longitude: {
- priority: 3,
- name: Strings.positionLongitude
- },
- valid: {
- priority: 4,
- name: Strings.positionValid
- },
- altitude: {
- priority: 5,
- name: Strings.positionAltitude
- },
- speed: {
- priority: 6,
- name: Strings.positionSpeed
- },
- course: {
- priority: 7,
- name: Strings.positionCourse
- },
- address: {
- priority: 8,
- name: Strings.positionAddress
- },
- protocol: {
- priority: 9,
- name: Strings.positionProtocol
+ keys: (function () {
+ var i, list, result;
+ result = {};
+ list = ['fixTime', 'latitude', 'longitude', 'valid', 'altitude', 'speed', 'course', 'address', 'protocol'];
+ for (i = 0; i < list.length; i++) {
+ result[list[i]] = {
+ priority: i,
+ name: Strings['position' + list[i].replace(/^\w/g, function (s) {
+ return s.toUpperCase();
+ })]
+ };
}
- },
+ return result;
+ }()),
formatValue: function (value) {
if (typeof (id) === 'number') {