From fe7b8bd58e23e289a041bc7c9a5d6c37f085419a Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Sat, 9 Jul 2016 13:26:33 +1200 Subject: Fix issues in JavaScript code --- web/app/store/CommandTypes.js | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'web/app/store') 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; } } -- cgit v1.2.3