Files
iD/js/id/presetdata.js
T
Tom MacWright 5bd95f6e6a Grab favorites, display them.
Show stuff nested in optional tags.
Fixes #582
2013-01-31 14:59:59 -05:00

25 lines
497 B
JavaScript

iD.presetData = function() {
var presets = {},
data = [];
presets.data = function(_) {
if (!arguments.length) return data;
data = _;
return presets;
};
presets.favs = function() {
return data.filter(function(d) {
return d.favorite;
});
};
presets.match = function(entity) {
return data.filter(function(d) {
return _.contains(d.type, entity.type);
});
};
return presets;
};