1
0
mirror of synced 2026-05-22 14:23:18 +00:00
Files
discourse-custom-header-links/javascripts/discourse/components/custom-header-links.hbs
T
Alan Guo Xiang Tan 73747938bd DEV: Migrate custom header links to new objects setting type (#53)
Why this change?

Since discourse/discourse@a440e15, we have started to support objects typed theme setting so we are switching this theme component to use it instead as it provides a much better UX for configuring the settings required for the theme component.
2024-04-23 11:50:20 +08:00

33 lines
806 B
Handlebars

{{#if this.shouldShow}}
{{!
@outletArgs.attrs.topic is the legacy version. Can be removed once core v3.2.0.beta4 is released
and this Theme's compatibility file is updated
}}
<ul
class="custom-header-links
{{if
(or @outletArgs.topic @outletArgs.attrs.topic)
'custom-header-links--hide-links'
}}"
>
{{#each this.links as |link|}}
<li
class={{concat-class
"headerLink"
link.device
link.locale
link.linkClass
link.hideOnScroll
}}
>
<a
title={{link.anchorAttributes.title}}
href={{link.anchorAttributes.href}}
target={{link.anchorAttributes.target}}
>
{{link.linkText}}
</a>
</li>
{{/each}}
</ul>
{{/if}}