aboutsummaryrefslogtreecommitdiff
path: root/web
diff options
context:
space:
mode:
authorAbyss777 <abyss@fox5.ru>2017-06-19 16:19:48 +0500
committerAbyss777 <abyss@fox5.ru>2017-06-19 16:19:48 +0500
commita1e1f5a8774c9f269b5fdf3620ab28fa5140a5b0 (patch)
treed07fb2afef678438a8fe9c94860e4e6a34aa7056 /web
parentb2b9e4cb213023697566885340d2ff7b5a44db8b (diff)
downloadtrackermap-web-a1e1f5a8774c9f269b5fdf3620ab28fa5140a5b0.tar.gz
trackermap-web-a1e1f5a8774c9f269b5fdf3620ab28fa5140a5b0.tar.bz2
trackermap-web-a1e1f5a8774c9f269b5fdf3620ab28fa5140a5b0.zip
Optimize store selection
Diffstat (limited to 'web')
-rw-r--r--web/app/AttributeFormatter.js6
1 files changed, 1 insertions, 5 deletions
diff --git a/web/app/AttributeFormatter.js b/web/app/AttributeFormatter.js
index f8bce1b1..2ddfd61e 100644
--- a/web/app/AttributeFormatter.js
+++ b/web/app/AttributeFormatter.js
@@ -65,11 +65,7 @@ Ext.define('Traccar.AttributeFormatter', {
groupIdFormatter: function (value) {
var group;
if (value !== 0) {
- if (Ext.getStore('AllGroups').getTotalCount() === 0) {
- group = Ext.getStore('Groups').getById(value);
- } else {
- group = Ext.getStore('AllGroups').getById(value);
- }
+ group = Ext.getStore(Ext.getStore('AllGroups').getTotalCount() === 0 ? 'Groups' : 'AllGroups').getById(value);
return group ? group.get('name') : value;
}
},