mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-29 22:01:49 +03:00
4c5144cb61
no issue The close button in the unsaved changes modal used the `@close` action directly compared to the "Stay" button which used `(fn @close false)`. The close button version without explicit arguments resulted in the first argument being a `PointerEvent` instance which if checked as a modal return value as `if (shouldClose)` would evaluate as truthy therefore matching the "Leave" behaviour instead of the "Stay" behaviour. - changed modal to explicitly call `(fn @close false)` when the close button is clicked - updated design settings route to have an explicit `shouldLeave === true` check so default behaviour is always "Stay"
56 lines
3.3 KiB
Handlebars
56 lines
3.3 KiB
Handlebars
<div class="flex flex-column h-100" {{css-transition "gh-nav-contextual"}} data-test-nav-menu="design" ...attributes>
|
|
<header class="gh-nav-header">
|
|
<LinkTo @route="settings" class="gh-nav-menu-back-button" data-test-link="back-to-settings">{{svg-jar "arrow-left-small"}} Settings</LinkTo>
|
|
</header>
|
|
<section class="gh-nav-body gh-nav-design">
|
|
<div class="gh-nav-top" {{on "click" this.transitionBackToIndex}}>
|
|
<div class="gh-nav-list gh-nav-main">
|
|
<LinkTo @route="settings.design" class="gh-nav-menu-title" @current-when="settings.design.index" {{on "click" this.closeAllSections}}>Site design</LinkTo>
|
|
|
|
{{#let (eq this.openSection "brand") as |isOpen|}}
|
|
<button class="gh-nav-design-tab {{if isOpen "active"}}" type="button" {{on "click" (fn this.toggleSection "brand")}} data-test-nav-toggle="general">
|
|
{{svg-jar "paintbrush"}} Brand
|
|
<span class="gh-nav-button-expand">{{svg-jar (if isOpen "arrow-up-stroke" "arrow-down-stroke")}}</span>
|
|
</button>
|
|
{{#liquid-if isOpen}}
|
|
<div class="gh-nav-design-settings" data-test-nav-group="general">
|
|
<Settings::Design::GeneralSettingsForm
|
|
@didUpdate={{perform this.themeManagement.updatePreviewHtmlTask}}
|
|
/>
|
|
</div>
|
|
{{/liquid-if}}
|
|
{{/let}}
|
|
|
|
{{#each this.customThemeSettings.settingGroups as |group|}}
|
|
{{#let (eq this.openSection group.key) as |isOpen|}}
|
|
<button class="gh-nav-design-tab {{if isOpen "active"}}" type="button" {{on "click" (fn this.toggleSection group.key)}}>
|
|
{{svg-jar group.icon}} {{group.name}}
|
|
<span class="gh-nav-button-expand">{{svg-jar (if isOpen "arrow-up-stroke" "arrow-down-stroke")}}</span>
|
|
</button>
|
|
|
|
{{#liquid-if isOpen}}
|
|
<div class="gh-nav-design-settings" data-test-nav-group={{group.key}}>
|
|
<Settings::Design::ThemeSettingsForm
|
|
@themeSettings={{group.settings}}
|
|
@updatePreview={{perform this.themeManagement.updatePreviewHtmlTask}}
|
|
/>
|
|
</div>
|
|
{{/liquid-if}}
|
|
{{/let}}
|
|
{{/each}}
|
|
</div>
|
|
</div>
|
|
|
|
<div class="gh-nav-bottom">
|
|
<div class="gh-change-theme">
|
|
<LinkTo class="gh-nav-design-tab" @route="settings.design.change-theme" {{on "click" this.closeAllSections}} data-test-nav="change-theme">
|
|
<div>
|
|
<span>Change theme</span>
|
|
<span class="active-theme" data-test-text="current-theme">Current: {{this.activeTheme.name}}{{#if this.activeTheme.package.version}} - v{{this.activeTheme.package.version}}{{/if}}</span>
|
|
</div>
|
|
<div class="gh-nav-design-tabicon">{{svg-jar "sync"}}</div>
|
|
</LinkTo>
|
|
</div>
|
|
</div>
|
|
</section>
|
|
</div> |