mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-02-24 23:48:13 -05:00
Koenig - Update {{koenig-card-html}} to use new {{koenig-card}} container
refs https://github.com/TryGhost/Ghost/issues/9311 - wraps embed card in same container as the markdown card to handle mouse selection/edit toggles etc - add render mode to embed card - autofocus CodeMirror editor when switching to edit mode - fix incorrect pointer on cards
This commit is contained in:
parent
26dd4ffb4a
commit
3f1e5b9fa9
5 changed files with 23 additions and 6 deletions
|
@ -21,6 +21,7 @@ const CmEditorComponent = Component.extend(InvokeActionMixin, {
|
||||||
indentUnit: 4,
|
indentUnit: 4,
|
||||||
mode: 'htmlmixed',
|
mode: 'htmlmixed',
|
||||||
theme: 'xq-light',
|
theme: 'xq-light',
|
||||||
|
autofocus: false,
|
||||||
|
|
||||||
_editor: null, // reference to CodeMirror editor
|
_editor: null, // reference to CodeMirror editor
|
||||||
_value: boundOneWay('value'), // make sure a value exists
|
_value: boundOneWay('value'), // make sure a value exists
|
||||||
|
|
|
@ -384,7 +384,7 @@
|
||||||
width: calc(100% + 60px);
|
width: calc(100% + 60px);
|
||||||
margin-left: -50px;
|
margin-left: -50px;
|
||||||
max-width: none;
|
max-width: none;
|
||||||
cursor: pointer;
|
cursor: default;
|
||||||
caret-color: auto; /* override hidden cursors around cards */
|
caret-color: auto; /* override hidden cursors around cards */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -3,10 +3,14 @@ import layout from '../templates/components/koenig-card-html';
|
||||||
import {set} from '@ember/object';
|
import {set} from '@ember/object';
|
||||||
|
|
||||||
export default Component.extend({
|
export default Component.extend({
|
||||||
tagName: '',
|
|
||||||
layout,
|
layout,
|
||||||
|
|
||||||
|
// attrs
|
||||||
payload: null,
|
payload: null,
|
||||||
|
isSelected: false,
|
||||||
|
isEditing: false,
|
||||||
|
|
||||||
|
// closure actions
|
||||||
saveCard: null,
|
saveCard: null,
|
||||||
|
|
||||||
init() {
|
init() {
|
||||||
|
|
|
@ -1,4 +1,17 @@
|
||||||
{{gh-cm-editor payload.html
|
{{#koenig-card
|
||||||
class="koenig-card-html--editor"
|
icon="koenig/embed"
|
||||||
update=(action "updateHtml")
|
isSelected=isSelected
|
||||||
|
isEditing=isEditing
|
||||||
|
selectCard=(action selectCard)
|
||||||
|
editCard=(action editCard)
|
||||||
}}
|
}}
|
||||||
|
{{#if isEditing}}
|
||||||
|
{{gh-cm-editor payload.html
|
||||||
|
class="koenig-card-html--editor"
|
||||||
|
autofocus=true
|
||||||
|
update=(action "updateHtml")
|
||||||
|
}}
|
||||||
|
{{else}}
|
||||||
|
{{{payload.html}}}
|
||||||
|
{{/if}}
|
||||||
|
{{/koenig-card}}
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
{{#koenig-card
|
{{#koenig-card
|
||||||
icon="koenig/markdown"
|
icon="koenig/markdown"
|
||||||
toolbar=toolbar
|
|
||||||
isSelected=isSelected
|
isSelected=isSelected
|
||||||
isEditing=isEditing
|
isEditing=isEditing
|
||||||
onEnterEdit=(action "enterEditMode")
|
onEnterEdit=(action "enterEditMode")
|
||||||
|
|
Loading…
Add table
Reference in a new issue