Skip to content
This repository has been archived by the owner on May 7, 2021. It is now read-only.

Commit

Permalink
fix(markdown): close click event emitter added
Browse files Browse the repository at this point in the history
  • Loading branch information
sanbornsen committed May 28, 2018
1 parent 6199866 commit c145e7d
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/app/markdown/examples/markdown-example.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
[rawText]="rawText"
[renderedText]="renderedText | safe: 'html'"
(onSaveClick)="onSaveOrPreview($event)"
(showPreview)="onSaveOrPreview($event)">
(showPreview)="onSaveOrPreview($event)"
(onCloseClick)="closeClicked()">
</f8-markdown>
</div>
</div>
Expand Down
4 changes: 4 additions & 0 deletions src/app/markdown/examples/markdown-example.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,4 +98,8 @@ export class MarkdownExampleComponent {
}, 2000);
}

closeClicked() {
console.log('Close clicked event works');
}

}
2 changes: 2 additions & 0 deletions src/app/markdown/markdown.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ export class MarkdownComponent implements OnChanges, OnInit, AfterViewChecked {
@Output() onActiveEditor = new EventEmitter();
@Output() onSaveClick = new EventEmitter();
@Output() showPreview = new EventEmitter();
@Output() onCloseClick = new EventEmitter();

@ViewChild('editorInput') editorInput: ElementRef;
@ViewChild('editorBox') editorBox: ElementRef;
Expand Down Expand Up @@ -267,6 +268,7 @@ export class MarkdownComponent implements OnChanges, OnInit, AfterViewChecked {
this.rawText = this.previousRawText;
this.renderedText = this.previousRenderedText;
this.deactivateEditor();
this.onCloseClick.emit();
}

renderPreview(rawText: string, renderedText: string) {
Expand Down

0 comments on commit c145e7d

Please sign in to comment.