mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-02-24 23:48:13 -05:00
Fixed snippet creation from email-cta card's toolbar
no issue - Glimmer components do not have a `.element` property so we need to set it manually because the editor currently reaches into card components to calculate the element's rect for selection when creating snippets
This commit is contained in:
parent
d45ba1aa78
commit
de480234e9
2 changed files with 8 additions and 0 deletions
|
@ -17,6 +17,7 @@
|
||||||
@moveCursorToPrevSection={{@moveCursorToPrevSection}}
|
@moveCursorToPrevSection={{@moveCursorToPrevSection}}
|
||||||
@moveCursorToNextSection={{@moveCursorToNextSection}}
|
@moveCursorToNextSection={{@moveCursorToNextSection}}
|
||||||
@editor={{@editor}}
|
@editor={{@editor}}
|
||||||
|
{{did-insert this.registerElement}}
|
||||||
as |card|
|
as |card|
|
||||||
>
|
>
|
||||||
{{#if @isEditing}}
|
{{#if @isEditing}}
|
||||||
|
|
|
@ -114,6 +114,13 @@ export default class KoenigCardEmailCtaComponent extends Component {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// required for snippet rects to be calculated - editor reaches in to component,
|
||||||
|
// expecting a non-Glimmer component with a .element property
|
||||||
|
@action
|
||||||
|
registerElement(element) {
|
||||||
|
this.element = element;
|
||||||
|
}
|
||||||
|
|
||||||
@action
|
@action
|
||||||
updateHtml(html) {
|
updateHtml(html) {
|
||||||
this._updatePayloadAttr('html', html);
|
this._updatePayloadAttr('html', html);
|
||||||
|
|
Loading…
Add table
Reference in a new issue