mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-30 14:22:07 +03:00
0b267098ea
refs https://github.com/TryGhost/Team/issues/1109 - added basic `<CustomThemeSettings::Text>` component that is displayed for any custom theme settings with the type `'text'`
20 lines
516 B
JavaScript
20 lines
516 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 CustomThemeSettingsTextComponent extends Component {
|
|
inputId = `input-${guidFor(this)}`;
|
|
inputName = camelize(this.args.setting.key);
|
|
|
|
@action
|
|
updateValue(event) {
|
|
this.args.setting.set('value', event.target.value);
|
|
}
|
|
|
|
@action
|
|
triggerOnChange() {
|
|
this.args.onChange?.();
|
|
}
|
|
}
|