mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-11-30 01:42:29 +03:00
f69674ff9a
refs TryGhost/Team#3122 - Fixed that preview takes data from user input before saving on backend. --- <!-- Leave the line below if you'd like GitHub Copilot to generate a summary from your commit --> <!-- copilot:summary --> ### <samp>🤖 Generated by Copilot at 54d5b2d</samp> This pull request adds the ability to preview the announcement bar in the Ghost admin panel and the theme settings. It also adds a confirmation dialog to discard or save unsaved changes before leaving the announcement bar settings. It refactors some components and methods to remove unnecessary or redundant calls to save the settings. It modifies the `ghost_head` helper, the `theme-management` service, and the `announcement-bar/src` files to support the preview feature.
26 lines
763 B
JavaScript
26 lines
763 B
JavaScript
import Component from '@glimmer/component';
|
|
import {action} from '@ember/object';
|
|
import {inject as service} from '@ember/service';
|
|
|
|
export default class AnnouncementSettingsBackgroundComponent extends Component {
|
|
@service settings;
|
|
|
|
get background() {
|
|
return this.settings.announcementBackground;
|
|
}
|
|
|
|
get options() {
|
|
return [
|
|
{value: 'dark', label: 'Dark', className: 'kg-headerstyle-btn-dark'},
|
|
{value: 'light', label: 'Light', className: 'kg-headerstyle-btn-light'},
|
|
{value: 'accent', label: 'Accent', className: 'kg-headerstyle-btn-accent'}
|
|
];
|
|
}
|
|
|
|
@action
|
|
setBackground(value) {
|
|
this.settings.announcementBackground = value;
|
|
this.args.onChange?.();
|
|
}
|
|
}
|