mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-11-24 06:35:49 +03:00
Added an emoji toggle for the callout card
refs https://github.com/TryGhost/Team/issues/1205 - Uses the KoenigSettingsPanel to display a toggle - The Emoji is set to an empty string when disabled - And arbitrarily set to 💡 by default when toggled back on
This commit is contained in:
parent
e51bcec5f1
commit
075d529e65
@ -33,6 +33,25 @@
|
||||
@onBlur={{action (mut this.isFocused) false}}
|
||||
@didCreateEditor={{action "registerEditor"}}
|
||||
/>
|
||||
<KoenigSettingsPanel>
|
||||
<div class="kg-settings-panel-control kg-settings-panel-control-horizontal">
|
||||
<div class="kg-settings-panel-control-label">Emoji</div>
|
||||
<div class="kg-settings-panel-control-input">
|
||||
<div class="for-switch">
|
||||
<label class="switch" for="has-emoji">
|
||||
<input
|
||||
type="checkbox"
|
||||
checked={{@payload.calloutEmoji}}
|
||||
id="has-emoji"
|
||||
onclick={{action "toggleEmoji"}}
|
||||
data-test-has-emoji
|
||||
>
|
||||
<span class="input-toggle-component"></span>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</KoenigSettingsPanel>
|
||||
</div>
|
||||
|
||||
{{else}}
|
||||
|
@ -107,6 +107,11 @@ export default class KoenigCardCalloutComponent extends Component {
|
||||
run.scheduleOnce('afterRender', this, this._placeCursorAtEnd);
|
||||
}
|
||||
|
||||
@action
|
||||
toggleEmoji() {
|
||||
this._updatePayloadAttr('calloutEmoji', this.args.payload.calloutEmoji ? '' : '💡');
|
||||
}
|
||||
|
||||
_enter(modifier) {
|
||||
if (this.args.isEditing && (modifier === 'meta' || (modifier === 'crtl' && Browser.isWin()))) {
|
||||
this.args.editCard();
|
||||
|
Loading…
Reference in New Issue
Block a user