aboutsummaryrefslogtreecommitdiff
path: root/web/app
diff options
context:
space:
mode:
authorAbyss777 <abyss@fox5.ru>2017-06-19 16:35:22 +0500
committerAbyss777 <abyss@fox5.ru>2017-06-19 16:35:22 +0500
commit56a5de3dc50e438884c5636c11f31e48bf19a15e (patch)
treee5d60feb3a6d17775c4b63379920d9ff88aaa379 /web/app
parenta1e1f5a8774c9f269b5fdf3620ab28fa5140a5b0 (diff)
downloadtrackermap-web-56a5de3dc50e438884c5636c11f31e48bf19a15e.tar.gz
trackermap-web-56a5de3dc50e438884c5636c11f31e48bf19a15e.tar.bz2
trackermap-web-56a5de3dc50e438884c5636c11f31e48bf19a15e.zip
Retrieve store once
Diffstat (limited to 'web/app')
-rw-r--r--web/app/AttributeFormatter.js8
1 files changed, 6 insertions, 2 deletions
diff --git a/web/app/AttributeFormatter.js b/web/app/AttributeFormatter.js
index 2ddfd61e..0c385672 100644
--- a/web/app/AttributeFormatter.js
+++ b/web/app/AttributeFormatter.js
@@ -63,9 +63,13 @@ Ext.define('Traccar.AttributeFormatter', {
},
groupIdFormatter: function (value) {
- var group;
+ var group, store;
if (value !== 0) {
- group = Ext.getStore(Ext.getStore('AllGroups').getTotalCount() === 0 ? 'Groups' : 'AllGroups').getById(value);
+ store = Ext.getStore('AllGroups');
+ if (store.getTotalCount() === 0) {
+ store = Ext.getStore('Groups');
+ }
+ group = store.getById(value);
return group ? group.get('name') : value;
}
},