adding emoji functionnal

This commit is contained in:
Nicolas Constant 2019-07-27 19:09:49 -04:00
parent f8d3f7b4f7
commit 8b72d551ec
No known key found for this signature in database
GPG Key ID: 1E9F677FB01A5688
3 changed files with 19 additions and 2 deletions

View File

@ -662,7 +662,12 @@ export class CreateStatusComponent implements OnInit, OnDestroy {
const compRef: ComponentRef<EmojiPickerComponent> = this.overlayRef.attach(comp);
compRef.instance.closedEvent.subscribe(() => {
this.overlayRef.dispose();
})
});
compRef.instance.emojiSelectedEvent.subscribe((emoji) => {
if(emoji){
this.status += ` ${emoji}`;
}
});
// overlayRef.backdropClick().subscribe(() => {

View File

@ -1,2 +1,7 @@
<emoji-mart [showPreview]="false" [perLine]="7" [isNative]="true" [sheetSize]="16"
<emoji-mart
[showPreview]="false"
[perLine]="7"
[isNative]="true"
[sheetSize]="16"
(emojiSelect)="emojiSelected($event)"
class="emojipicker" title="Pick your emoji…" emoji="point_up"></emoji-mart>

View File

@ -9,6 +9,7 @@ export class EmojiPickerComponent implements OnInit {
private init = false;
@Output('closed') public closedEvent = new EventEmitter();
@Output('emojiSelected') public emojiSelectedEvent = new EventEmitter<string>();
constructor(private eRef: ElementRef) { }
@ -26,4 +27,10 @@ export class EmojiPickerComponent implements OnInit {
this.init = true;
}, 0);
}
emojiSelected(select: any): boolean {
console.warn(select);
this.emojiSelectedEvent.next(select.emoji.native);
return false;
}
}