mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-11-30 01:42:29 +03:00
a5dd92f1b8
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
40 lines
1.6 KiB
Handlebars
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> |