Use JSPM for frontend JS modules

This commit is contained in:
Arne Schlüter 2015-02-08 03:44:05 +01:00
commit 384e9adbd7
17 changed files with 5293 additions and 127 deletions

19
static/js/filter.js Normal file
View file

@ -0,0 +1,19 @@
export default {
/**
* Returns only the incidents which fall into the given categories
* @param {Array[Object]} data The incidents to filter
* @param {Array[String]} categories
* @return {Arreay[Obect]}
*/
categories: function (data, categories) {
return response.filter(function (incident) {
for (var i = 0, l = incident.categories.length; i < l; i++)
if (categories.indexOf(incident.categories[i]) !== -1)
return true;
return false;
});
}
}