mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-24 19:33:02 +03: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
@ -17,6 +17,7 @@
|
||||
@moveCursorToPrevSection={{@moveCursorToPrevSection}}
|
||||
@moveCursorToNextSection={{@moveCursorToNextSection}}
|
||||
@editor={{@editor}}
|
||||
{{did-insert this.registerElement}}
|
||||
as |card|
|
||||
>
|
||||
{{#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
|
||||
updateHtml(html) {
|
||||
this._updatePayloadAttr('html', html);
|
||||
|
Loading…
Reference in New Issue
Block a user