diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2016-07-09 13:26:33 +1200 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2016-07-09 13:26:33 +1200 |
commit | fe7b8bd58e23e289a041bc7c9a5d6c37f085419a (patch) | |
tree | d28b58d1ea3b4fcd6c715c4f2d2e2e04cb91c208 /web/app/store | |
parent | 70d22de4205aec294660378f0d854cbc32c7a6b8 (diff) | |
download | trackermap-server-fe7b8bd58e23e289a041bc7c9a5d6c37f085419a.tar.gz trackermap-server-fe7b8bd58e23e289a041bc7c9a5d6c37f085419a.tar.bz2 trackermap-server-fe7b8bd58e23e289a041bc7c9a5d6c37f085419a.zip |
Fix issues in JavaScript code
Diffstat (limited to 'web/app/store')
-rw-r--r-- | web/app/store/CommandTypes.js | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/web/app/store/CommandTypes.js b/web/app/store/CommandTypes.js index 2ef190edc..d3825fb95 100644 --- a/web/app/store/CommandTypes.js +++ b/web/app/store/CommandTypes.js @@ -19,7 +19,7 @@ Ext.define('Traccar.store.CommandTypes', { fields: ['type', 'name'], listeners: { - 'beforeload' : function(store) { + 'beforeload' : function (store) { var proxy; proxy = store.getProxy(); proxy.setUrl('/api/commandtypes?deviceId' + proxy.extraParams.deviceId); @@ -31,13 +31,14 @@ Ext.define('Traccar.store.CommandTypes', { url: '', reader: { type: 'json', - getData: function(data) { - Ext.each(data, function(entry) { + getData: function (data) { + Ext.each(data, function (entry) { + var nameKey, name; entry.name = entry.type; - if (typeof entry.type !== "undefined") { - var nameKey = 'command' + entry.type.charAt(0).toUpperCase() + entry.type.slice(1); - var name = Strings[nameKey]; - if (typeof name !== "undefined") { + if (typeof entry.type !== 'undefined') { + nameKey = 'command' + entry.type.charAt(0).toUpperCase() + entry.type.slice(1); + name = Strings[nameKey]; + if (typeof name !== 'undefined') { entry.name = name; } } |