mirror of
https://github.com/FoggedLens/iD.git
synced 2026-05-22 08:17:30 +02:00
Added countThreshold to limit presets
Didn’t realize the presets would be so large, here’s a way of throttling them based on the count property if we need to.
This commit is contained in:
@@ -90,7 +90,8 @@ function generateFields() {
|
||||
}
|
||||
|
||||
function suggestionsToPresets(presets) {
|
||||
var existing = {};
|
||||
var existing = {},
|
||||
countThreshold = 0;
|
||||
|
||||
for (var preset in presets) {
|
||||
existing[presets[preset].name] = {
|
||||
@@ -112,7 +113,7 @@ function suggestionsToPresets(presets) {
|
||||
|
||||
tags.name = name;
|
||||
|
||||
if (!existing[name]) addPreset(item, tags, name, count);
|
||||
if (!existing[name] && count > countThreshold) addPreset(item, tags, name, count);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user