mirror of
https://github.com/heyarne/berliner-winter.git
synced 2026-05-06 19:23:39 +02:00
Merge branch 'master' of github.com:aesthaddicts/OpenData
This commit is contained in:
commit
29e4d599c1
2 changed files with 10 additions and 5 deletions
|
|
@ -8,11 +8,16 @@ export default {
|
|||
*/
|
||||
byCategories: function (data, categories) {
|
||||
return data.filter(function (incident) {
|
||||
for (var i = 0, l = incident.categories.length; i < l; i++)
|
||||
if (categories.indexOf(incident.categories[i]) !== -1)
|
||||
if(incident.categories.length > 0) {
|
||||
for (var i = 0, l = incident.categories.length; i < l; i++)
|
||||
if (categories.indexOf(incident.categories[i]) !== -1)
|
||||
return true
|
||||
} else {
|
||||
if(categories.indexOf("uncategorized") !== -1)
|
||||
return true
|
||||
|
||||
return false
|
||||
else
|
||||
return false
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue