simplify the DOM using conditionals instead of reveal

This commit is contained in:
pmario 2024-01-26 01:35:43 +01:00
parent 28df050b80
commit 336c111627
1 changed files with 6 additions and 9 deletions

View File

@ -6,22 +6,19 @@ caption: {{$:/language/ControlPanel/Palette/Caption}}
\whitespace trim
\procedure paletteEditorButton()
<$reveal type="nomatch" state="$:/state/ShowPaletteEditor" text="yes">
<% if [{$:/state/ShowPaletteEditor}!match[yes]] %>
<$button set="$:/state/ShowPaletteEditor" setTo="yes"><<lingo ShowEditor/Caption>></$button>
</$reveal>
<$reveal type="match" state="$:/state/ShowPaletteEditor" text="yes">
<% else %>
<$button set="$:/state/ShowPaletteEditor" setTo="no"><<lingo HideEditor/Caption>></$button>
{{$:/PaletteManager}}
</$reveal>
<% endif %>
\end
{{$:/core/ui/ControlPanel/Palette/LightDarkConfig}}
<$list filter="[{$:/config/palette/enable-light-dark-detection}match[yes]]" variable="ignore">
<% if [{$:/config/palette/enable-light-dark-detection}match[yes]] %>
<<paletteEditorButton>>
</$list>
<$list filter="[{$:/config/palette/enable-light-dark-detection}!match[yes]]" variable="ignore">
<% else %>
!! <<lingo "Switcher/Heading">>
@ -29,4 +26,4 @@ caption: {{$:/language/ControlPanel/Palette/Caption}}
<<paletteEditorButton>>
</$list>
<% endif %>