From f627f1e659afc24799861c2f86425be0b48391d8 Mon Sep 17 00:00:00 2001 From: Max Grossman Date: Fri, 14 Dec 2018 13:29:17 -0500 Subject: [PATCH] make all presets visible on init!! --- modules/presets/index.js | 4 ++-- modules/ui/preset_list.js | 6 ++++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/modules/presets/index.js b/modules/presets/index.js index 8cf233a62..fa641cc5c 100644 --- a/modules/presets/index.js +++ b/modules/presets/index.js @@ -175,13 +175,13 @@ export function presetIndex() { }; all.init = function() { - all.collection = []; + all.collection = []; _recent.collection = []; _fields = {}; _universal = []; _index = { point: {}, vertex: {}, line: {}, area: {}, relation: {} }; - return all.build(data.presets); + return all.build(data.presets, true); }; diff --git a/modules/ui/preset_list.js b/modules/ui/preset_list.js index e82522b45..336cb3155 100644 --- a/modules/ui/preset_list.js +++ b/modules/ui/preset_list.js @@ -152,8 +152,10 @@ export function uiPresetList(context) { function drawList(list, presets) { var collection = presets.collection.reduce(function(collection, preset) { - if (preset.visible()) { - collection.push(preset.members ? CategoryItem(preset) : PresetItem(preset)); + if (preset.members) { + collection.push(CategoryItem(preset)); + } else if (preset.visible()) { + collection.push(PresetItem(preset)); } return collection; }, []);