0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-02-03 23:00:14 -05:00

Added onBlur handler for announcement editor

refs TryGhost/Team#3009
This commit is contained in:
Elena Baidakova 2023-04-20 13:21:55 +04:00 committed by Elena Baidakova
parent 4c4e5a9c95
commit d36f3618c0
4 changed files with 4 additions and 7 deletions

View file

@ -8,6 +8,7 @@
@placeholderText="Breaking news, a big story, a special offer, or any other message"
@html={{this.content}}
@onChangeHtml={{this.setContent}}
@onBlur={{@onChange}}
/>
</div>
</div>

View file

@ -1,6 +1,5 @@
import Component from '@glimmer/component';
import {action} from '@ember/object';
import {debounce} from '@ember/runloop';
import {inject as service} from '@ember/service';
export default class AnnouncementSettingsContentComponent extends Component {
@ -10,14 +9,9 @@ export default class AnnouncementSettingsContentComponent extends Component {
return this.settings.announcementContent;
}
updatePreview() {
debounce(this, this.args.onChange, 300);
}
@action
setContent(html) {
this.settings.announcementContent = html;
this.settings.save();
this.updatePreview();
}
}

View file

@ -2,5 +2,6 @@
placeholderText=@placeholderText
html=@html
onChangeHtml=@onChangeHtml
onBlur=@onBlur
)
}}></div>

View file

@ -128,7 +128,8 @@ export default class KoenigLexicalEditorInput extends Component {
>
<KoenigComposableEditor
darkMode={this.feature.nightShift}
onChange={this.args.onChange}
onChange={props.onChange}
onBlur={props.onBlur}
isSnippetsEnabled={false}
singleParagraph={true}
className="koenig-lexical-editor-input"