diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2015-09-22 11:12:47 +1200 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2015-09-22 11:12:47 +1200 |
commit | c3eb0a64c586e2bb71494fa2054ba9cea7ec3a2e (patch) | |
tree | eb836d7a57b6f5479bd9eb4424898755a622b4c9 /web/app/Application.js | |
parent | 32ac45e2e96baa970eca750a706d8bc823512844 (diff) | |
download | trackermap-server-c3eb0a64c586e2bb71494fa2054ba9cea7ec3a2e.tar.gz trackermap-server-c3eb0a64c586e2bb71494fa2054ba9cea7ec3a2e.tar.bz2 trackermap-server-c3eb0a64c586e2bb71494fa2054ba9cea7ec3a2e.zip |
Move server decoding to application
Diffstat (limited to 'web/app/Application.js')
-rw-r--r-- | web/app/Application.js | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/web/app/Application.js b/web/app/Application.js index 1a9326dd1..67dc96536 100644 --- a/web/app/Application.js +++ b/web/app/Application.js @@ -62,8 +62,11 @@ Ext.define('Traccar.Application', { return this.user; }, - setServer: function(server) { - this.server = server; + setServer: function(data) { + var reader = Ext.create('Ext.data.reader.Json', { + model: 'Traccar.model.Server' + }); + this.server = reader.readRecords(data).getRecords()[0]; }, getServer: function() { @@ -73,5 +76,4 @@ Ext.define('Traccar.Application', { getPreference: function(key, defaultValue) { return this.getUser().get(key) || this.getServer().get(key) || defaultValue; } - }); |