diff options
author | Gábor Somogyi <gabor.g.somogyi@gmail.com> | 2016-05-02 01:08:59 +0200 |
---|---|---|
committer | Gábor Somogyi <gabor.g.somogyi@gmail.com> | 2016-05-02 01:08:59 +0200 |
commit | 97c2c3d47a7e6ef094038091649c130d2de4b016 (patch) | |
tree | 091d72f2a7aac024c76d43bfb6c1be6c808ff786 /web/app/store | |
parent | 9d5b2230caa434db5bff773b4ffa980da2adc15c (diff) | |
download | trackermap-server-97c2c3d47a7e6ef094038091649c130d2de4b016.tar.gz trackermap-server-97c2c3d47a7e6ef094038091649c130d2de4b016.tar.bz2 trackermap-server-97c2c3d47a7e6ef094038091649c130d2de4b016.zip |
Concept update + UI translation support
Diffstat (limited to 'web/app/store')
-rw-r--r-- | web/app/store/SupportedCommands.js | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/web/app/store/SupportedCommands.js b/web/app/store/SupportedCommands.js index 2b052b902..64e4af88d 100644 --- a/web/app/store/SupportedCommands.js +++ b/web/app/store/SupportedCommands.js @@ -19,10 +19,22 @@ Ext.define('Traccar.store.SupportedCommands', { model: 'Traccar.model.SupportedCommand', listeners: { - 'beforeload' : function(store, options) { + 'beforeload' : function(store, eOpts) { var proxy; proxy = store.getProxy(); - proxy.setUrl('/api/devices/' + proxy.extraParams.deviceId + '/supportedcommands'); + proxy.setUrl('/api/supportedcommands?deviceId' + proxy.extraParams.deviceId); + }, + 'load' : function(store, records, successful, eOpts) { + if (typeof records !== "undefined") { + records.forEach(function(entry) { + if (typeof entry !== "undefined" && typeof entry.data.name !== "undefined") { + var translatedName = Strings[entry.data.name]; + if (typeof translatedName !== "undefined") { + entry.data.name = translatedName; + } + } + }, this); + } } }, |