Improve tag visibility toggle logic (#4425) * Improve tag visibility toggle logic Cache selector once, and remove hardcoded animation duration. Takes 300 tags down from 3 seconds down to 2ms per toggle. * whitespace fix

6166348ec803e5a233f57bb9061955d380775ed9

DepFA <35278260+dfaker@users.noreply.github.com>

Signed
1 files changed, +9 -3Showing whitespace changes
public/scripts/tags.js+9 -3
@@ -1822,12 +1822,18 @@ const debouncedTagColoring = debounce((tagId, cssProperty, newColor) => {
18221822
18231823function onTagListHintClick() {
18241824 $(this).toggleClass('selected');
1825- $(this).siblings('.tag:not(.actionable)').toggle(100);
1826- $(this).siblings('.innerActionable').toggleClass('hidden');
18271825
1826+ const $tagSiblings = $(this).siblings('.tag:not(.actionable)');
1827+
1828+ if ($(this).hasClass('selected')) {
1829+ $tagSiblings.show();
1830+ } else {
1831+ $tagSiblings.hide();
1832+ }
1833+
1834+ $(this).siblings('.innerActionable').toggleClass('hidden');
18281835 power_user.show_tag_filters = $(this).hasClass('selected');
18291836 saveSettingsDebounced();
1830-
18311837 console.debug('show_tag_filters', power_user.show_tag_filters);
18321838}
18331839