Files
iD/js/id/presets/category.js
2013-05-13 17:48:18 -07:00

26 lines
598 B
JavaScript

iD.presets.Category = function(id, category, all) {
category = _.clone(category);
category.id = id;
category.members = iD.presets.Collection(category.members.map(function(id) {
return all.item(id);
}));
category.matchGeometry = function(geometry) {
return category.geometry.indexOf(geometry) >= 0;
};
category.matchScore = function() { return -1; };
category.name = function() {
return t('presets.categories.' + id + '.name', {'default': id});
};
category.terms = function() {
return [];
};
return category;
};