Add close of open section when clicking "Site design" nav heading

refs https://github.com/orgs/TryGhost/projects/51

- always reset the open section when the header link is clicked to collapse any open setting groups
This commit is contained in:
Kevin Ansfield 2021-10-18 17:37:45 +01:00
parent d7fefd70cc
commit eda694b69f
2 changed files with 6 additions and 1 deletions

View File

@ -4,7 +4,7 @@
<section class="gh-nav-body gh-nav-design"> <section class="gh-nav-body gh-nav-design">
<div class="gh-nav-top" {{on "click" this.transitionBackToIndex}}> <div class="gh-nav-top" {{on "click" this.transitionBackToIndex}}>
<div class="gh-nav-list gh-nav-main"> <div class="gh-nav-list gh-nav-main">
<LinkTo @route="settings.design" class="gh-nav-menu-title">Site design</LinkTo> <LinkTo @route="settings.design" class="gh-nav-menu-title" {{on "click" this.closeAllSections}}>Site design</LinkTo>
{{#let (eq this.openSection "brand") as |isOpen|}} {{#let (eq this.openSection "brand") as |isOpen|}}
<button class="gh-nav-design-tab {{if isOpen "active"}}" type="button" {{on "click" (fn this.toggleSection "brand")}}> <button class="gh-nav-design-tab {{if isOpen "active"}}" type="button" {{on "click" (fn this.toggleSection "brand")}}>
<span class="gh-nav-button-expand">{{svg-jar (if isOpen "arrow-down-stroke" "arrow-right-stroke")}}</span> <span class="gh-nav-button-expand">{{svg-jar (if isOpen "arrow-down-stroke" "arrow-right-stroke")}}</span>

View File

@ -55,4 +55,9 @@ export default class DesignMenuComponent extends Component {
this.router.transitionTo('settings.design.index'); this.router.transitionTo('settings.design.index');
} }
} }
@action
closeAllSections() {
this.openSection = null;
}
} }