Skip to content

Commit

Permalink
Handle editorId not being provided
Browse files Browse the repository at this point in the history
  • Loading branch information
lucasbesen committed Jul 12, 2021
1 parent 247bb68 commit ac00684
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion projects/email-editor/src/lib/email-editor.component.html
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<div [id]="editorId" class="unlayer-editor" [style.min-height]="minHeight"></div>
<div [id]="id" class="unlayer-editor" [style.min-height]="minHeight"></div>
7 changes: 6 additions & 1 deletion projects/email-editor/src/lib/email-editor.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,18 @@ export class EmailEditorComponent implements OnInit, AfterViewInit {
@Input() tools: object;
@Input() appearance: object;
@Input() locale: string;
@Input() id: string;

@Input() minHeight = '500px';

@Output() loaded = new EventEmitter();

editor: any;

constructor() {
this.id = this.editorId || `editor-${++lastEditorId}`;
}

ngOnInit() {}

ngAfterViewInit() {
Expand Down Expand Up @@ -73,7 +78,7 @@ export class EmailEditorComponent implements OnInit, AfterViewInit {

this.editor = unlayer.createEditor({
...options,
id: this.editorId || `editor-${++lastEditorId}`,
id: this.id,
displayMode: 'email',
source: {
name: pkg.name,
Expand Down

0 comments on commit ac00684

Please sign in to comment.