Both buttons have the same fore example: popup=<<qualify "$:/state/popup/language">>
. If I open the popup using the first button A I have to close the popup before I can open the popup using the other button B. If they had different popups, this wouldn’t happen.
In the example I provided (the simplest I could find, I just copied $:/core/ui/Buttons/language
and added 2 buttons) it is not a big problem, but I’m finding it annoying with other popups.
e.g.
Button A opens the popup: You last pressed the “A” button
Button B opens the popup: You last pressed the “B” button
I’d prefer to define only one popup and not two different because the popup could be rather long but only some little things changes based on the button I pressed.
Example test:
\define flag-title()
$(languagePluginTitle)$/icon
\end
<span class="tc-popup-keep">
<$button popup=<<qualify "$:/state/popup/language">> tooltip={{$:/language/Buttons/Language/Hint}} aria-label={{$:/language/Buttons/Language/Caption}} class=<<tv-config-toolbar-class>> selectedClass="tc-selected">
<$list filter="[<tv-config-toolbar-icons>match[yes]]">
<span class="tc-image-button">
<$set name="languagePluginTitle" value={{$:/language}}>
<$image source=<<flag-title>>/>
</$set>
</span>
</$list>
<$list filter="[<tv-config-toolbar-text>match[yes]]">
<span class="tc-btn-text"><$text text={{$:/language/Buttons/Language/Caption}}/></span>
</$list>
</$button>
</span>
<$reveal state=<<qualify "$:/state/popup/language">> type="popup" position="below" animate="yes">
<div class="tc-drop-down">
{{$:/snippets/languageswitcher}}
</div>
</$reveal>
<$button popup=<<qualify "$:/state/popup/language">>>
A
</$button>
<$button popup=<<qualify "$:/state/popup/language">>>
B
</$button>
- How can I make the button open the popup right away without having to close it first?
P.S.
I also added a third button "C" that opens the Palette popup to see what happens if two buttons have different popups:
\define flag-title()
$(languagePluginTitle)$/icon
\end
<span class="tc-popup-keep">
<$button popup=<<qualify "$:/state/popup/language">> tooltip={{$:/language/Buttons/Language/Hint}} aria-label={{$:/language/Buttons/Language/Caption}} class=<<tv-config-toolbar-class>> selectedClass="tc-selected">
<$list filter="[<tv-config-toolbar-icons>match[yes]]">
<span class="tc-image-button">
<$set name="languagePluginTitle" value={{$:/language}}>
<$image source=<<flag-title>>/>
</$set>
</span>
</$list>
<$list filter="[<tv-config-toolbar-text>match[yes]]">
<span class="tc-btn-text"><$text text={{$:/language/Buttons/Language/Caption}}/></span>
</$list>
</$button>
</span>
<$reveal state=<<qualify "$:/state/popup/language">> type="popup" position="below" animate="yes">
<div class="tc-drop-down">
{{$:/snippets/languageswitcher}}
</div>
</$reveal>
<span class="tc-popup-keep">
<$button popup=<<qualify "$:/state/popup/palette">> tooltip={{$:/language/Buttons/Palette/Hint}} aria-label={{$:/language/Buttons/Palette/Caption}} class=<<tv-config-toolbar-class>> selectedClass="tc-selected">
<$list filter="[<tv-config-toolbar-icons>match[yes]]">
{{$:/core/images/palette}}
</$list>
<$list filter="[<tv-config-toolbar-text>match[yes]]">
<span class="tc-btn-text"><$text text={{$:/language/Buttons/Palette/Caption}}/></span>
</$list>
</$button>
</span>
<$reveal state=<<qualify "$:/state/popup/palette">> type="popup" position="below" animate="yes">
<div class="tc-drop-down" style="font-size:0.7em;">
{{$:/snippets/paletteswitcher}}
</div>
</$reveal>
<$button popup=<<qualify "$:/state/popup/language">>>
A
</$button>
<$button popup=<<qualify "$:/state/popup/language">>>
B
</$button>
<$button popup=<<qualify "$:/state/popup/palette">>>
C
</$button>
If you click on “A” and then on “B” you’ll see the popup disappear and no popup is opened in its place, then if you click “B” and then “C” you’ll see the language popup being opened and then the palette one being opened in its place once “C” is clicked