mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-22 18:31:57 +03:00
019b22caa1
refs https://github.com/TryGhost/Team/issues/1310 - we had a `<GhBrowserPreview>` component but it wasn't being used everywhere because it's behaviour didn't match the mobile/desktop switch with no iframe re-render that we needed for some screens - updated component to match all required behaviour - include a switch between desktop and mobile views - default fallbacks for `@title` and `@icon` arguments - switched design settings themes over to using the component instead of repeating the same set of markup
41 lines
2.0 KiB
Handlebars
41 lines
2.0 KiB
Handlebars
<section class="gh-canvas gh-design" {{on-key "cmd+s" this.saveFromKeyboard}}>
|
|
<GhCanvasHeader class="gh-canvas-header">
|
|
<h2 class="gh-canvas-title">Site design</h2>
|
|
<section class="view-actions">
|
|
<div class="gh-select gh-design-page-preview-mode">
|
|
<OneWaySelect
|
|
@value={{this.themeManagement.previewType}}
|
|
@options={{this.themeManagement.availablePreviewTypes}}
|
|
@optionValuePath="name"
|
|
@optionLabelPath="label"
|
|
@optionTargetPath="name"
|
|
@update={{this.themeManagement.setPreviewType}}
|
|
/>
|
|
{{svg-jar "arrow-down-small"}}
|
|
</div>
|
|
|
|
<div class="gh-contentfilter gh-btn-group">
|
|
<button type="button" class="gh-btn gh-design-preview-mode {{if this.isDesktopPreview "gh-btn-group-selected"}}" {{on "click" (fn this.setPreviewSize "desktop")}} data-test-button="desktop-preview"><span>{{svg-jar "desktop"}}</span></button>
|
|
<button type="button" class="gh-btn gh-design-preview-mode {{if this.isMobilePreview "gh-btn-group-selected"}}" {{on "click" (fn this.setPreviewSize "mobile")}} data-test-button="mobile-preview"><span>{{svg-jar "mobile-phone"}}</span></button>
|
|
</div>
|
|
|
|
<GhTaskButton
|
|
@buttonText="Save changes"
|
|
@task={{this.saveTask}}
|
|
@successText="Saved"
|
|
@runningText="Saving"
|
|
@class="gh-btn gh-btn-primary gh-btn-icon"
|
|
data-test-button="save-settings"
|
|
/>
|
|
</section>
|
|
</GhCanvasHeader>
|
|
|
|
<div class="view-container">
|
|
<GhBrowserPreview @isMobilePreview={{this.isMobilePreview}}>
|
|
<GhHtmlIframe
|
|
class={{if this.isMobilePreview "gh-post-preview-iframe" "site-frame"}}
|
|
@html={{this.themeManagement.previewHtml}}
|
|
@pageId={{this.themeManagement.previewType}} />
|
|
</GhBrowserPreview>
|
|
</div>
|
|
</section> |