From a3f397341968e68562a6a1e83277d89d31ccc55a Mon Sep 17 00:00:00 2001 From: Jason Savell Date: Tue, 18 Jun 2024 10:00:01 -0500 Subject: [PATCH] add change event for wysiwyg --- .../src/lib/wvr-wysiwyg/wvr-wysiwyg.component.ts | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/projects/wvr-elements/src/lib/wvr-wysiwyg/wvr-wysiwyg.component.ts b/projects/wvr-elements/src/lib/wvr-wysiwyg/wvr-wysiwyg.component.ts index 15c11a16..c181be80 100644 --- a/projects/wvr-elements/src/lib/wvr-wysiwyg/wvr-wysiwyg.component.ts +++ b/projects/wvr-elements/src/lib/wvr-wysiwyg/wvr-wysiwyg.component.ts @@ -42,6 +42,8 @@ export class WvrWysiwygComponent extends WvrBaseComponent implements OnInit, OnD @Input() emitSaveEvent: string; + @Input() emitChangeEvent: string; + @Input() set height(height: string) { this.config.height = height; } get height(): string { return this.config.height; } @@ -108,6 +110,18 @@ export class WvrWysiwygComponent extends WvrBaseComponent implements OnInit, OnD })); } + onChange($event): void { + if (this.emitChangeEvent) { + this.eRef.nativeElement.dispatchEvent(new CustomEvent(this.emitChangeEvent, { + bubbles: true, + detail: { + data: this.content, + wysiwyg: this + } + })); + } + } + onSave($event): void { this.store.dispatch(WysiwygActions.saveWysiwyg({ content: this.content,