Ghost/ghost/admin/app/components/gh-koenig-editor.hbs
Kevin Ansfield a5dd92f1b8 Changed editor title input to treat '(Untitled)' as blank
refs https://github.com/TryGhost/Team/issues/707

- the switch to a hard `'(Untitled)'` when you start typing is jarring and pulls you away from writing to want to set a title
- by changing the input to treat '(Untitled)' as a blank value the placeholder continues to be shown so flow isn't broken. Post validation and title display elsewhere in the app is unaffected because we're still setting `'(Untitled')` under the hood, it's only the editor display that changes
2021-05-27 18:18:51 +01:00

40 lines
1.6 KiB
Handlebars

<div class="gh-koenig-editor relative w-100 vh-100 overflow-x-hidden overflow-y-auto z-0" {{did-insert this.registerElement}} ...attributes>
{{!-- full height content pane --}}
<div
class="gh-koenig-editor-pane flex flex-column mih-100"
{{on "mousedown" this.trackMousedown}}
{{on "mouseup" this.focusEditor}}
>
<GhTextarea
@class="gh-editor-title"
@placeholder={{@titlePlaceholder}}
@tabindex="1"
@autoExpand=".gh-koenig-editor"
@value={{readonly this.title}}
@input={{this.updateTitle}}
@focus-out={{optional @onTitleBlur}}
@keyDown={{this.onTitleKeydown}}
@didCreateTextarea={{this.registerTitleElement}}
data-test-editor-title-input={{true}}
/>
<KoenigEditor
@mobiledoc={{@body}}
@placeholder={{@bodyPlaceholder}}
@autofocus={{or @bodyAutofocus false}}
@spellcheck={{true}}
@onChange={{@onBodyChange}}
@didCreateEditor={{this.onEditorCreated}}
@cursorDidExitAtTop={{this.focusTitle}}
@headerOffset={{@headerOffset}}
@dropTargetSelector=".gh-koenig-editor-pane"
@scrollContainerSelector={{@scrollContainerSelector}}
@scrollOffsetTopSelector={{@scrollOffsetTopSelector}}
@scrollOffsetBottomSelector={{@scrollOffsetBottomSelector}}
@wordCountDidChange={{@onWordCountChange}}
@snippets={{@snippets}}
@saveSnippet={{@saveSnippet}}
@deleteSnippet={{@deleteSnippet}}
/>
</div>
</div>