mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-20 17:32:15 +03:00
dab672c7b8
refs https://github.com/TryGhost/Team/issues/1097 - added `customThemeSettings.keyValueObject` which returns a plain object with setting values assign to the setting keys on the object - updated customize modal's preview data generation to use `customThemeSettings.keyValueObject` to assign a JSON-stringified version to the `custom` param on the `x-ghost-preview` header - updated theme settings `<Select>` component to call the passed through `updatePreview()` action when the value changes
17 lines
520 B
JavaScript
17 lines
520 B
JavaScript
import Component from '@glimmer/component';
|
|
import {action} from '@ember/object';
|
|
import {camelize} from '@ember/string';
|
|
import {guidFor} from '@ember/object/internals';
|
|
|
|
export default class CustomThemeSettingsSelectComponent extends Component {
|
|
selectId = `select-${guidFor(this)}`;
|
|
selectName = camelize(this.args.setting.key);
|
|
|
|
@action
|
|
setSelection(changeEvent) {
|
|
const value = changeEvent.target.value;
|
|
this.args.setting.set('value', value);
|
|
this.args.onChange?.();
|
|
}
|
|
}
|