FIX: dot not close emoji-picker when click is inside picker

This commit is contained in:
Joffrey JAFFEUX 2017-07-21 12:01:39 +02:00
parent 0c9ea1aaf2
commit 1ca0c33802
1 changed files with 3 additions and 1 deletions

View File

@ -148,7 +148,9 @@ export default Ember.Component.extend({
.on("click", () => this.set("active", false));
this.$(document).on("click.emoji-picker", (event) => {
if(event.target.className.indexOf("grippie") === -1) {
const onPicker = $(event.target).parents(".emoji-picker").length === 1;
const onGrippie = event.target.className.indexOf("grippie") > -1;
if(!onPicker && !onGrippie) {
this.set("active", false);
return false;
}