DEV: Colocate mobile-nav template (#25016)

Previously it was relying on the `templates/mobile` logic to make this a simple div wrapper on mobile, and a more complex implementation on mobile. This commit colocates the template so it's active on mobile and desktop, but adds an `{{#if` block to explicitly change the behavior.
This commit is contained in:
David Taylor 2024-01-02 10:47:21 +00:00 committed by GitHub
parent 236f3cc6eb
commit e47ad13122
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 15 additions and 11 deletions

View File

@ -0,0 +1,15 @@
{{#if this.site.mobileView}}
{{#if this.selectedHtml}}
<li>
<a href {{on "click" this.toggleExpanded}} class="expander">
<span class="selection">{{html-safe this.selectedHtml}}</span>
{{d-icon "caret-down"}}
</a>
</li>
{{/if}}
<ul class="drop {{if this.expanded 'expanded'}}">
{{yield}}
</ul>
{{else}}
{{yield}}
{{/if}}

View File

@ -1,11 +0,0 @@
{{#if this.selectedHtml}}
<li>
<a href {{on "click" this.toggleExpanded}} class="expander">
<span class="selection">{{html-safe this.selectedHtml}}</span>
{{d-icon "caret-down"}}
</a>
</li>
{{/if}}
<ul class="drop {{if this.expanded 'expanded'}}">
{{yield}}
</ul>