summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/set_status_modal/emoji_menu_in_modal.js
blob: 14a89ef9293c8fff452e00c783f9f0cf38be5a76 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
import { AwardsHandler } from '~/awards_handler';

class EmojiMenuInModal extends AwardsHandler {
  constructor(emoji, toggleButtonSelector, menuClass, selectEmojiCallback, targetContainerEl) {
    super(emoji);

    this.selectEmojiCallback = selectEmojiCallback;
    this.toggleButtonSelector = toggleButtonSelector;
    this.menuClass = menuClass;
    this.targetContainerEl = targetContainerEl;

    this.bindEvents();
  }

  postEmoji($emojiButton, awardUrl, selectedEmoji, callback) {
    this.selectEmojiCallback(selectedEmoji, this.emoji.glEmojiTag(selectedEmoji));
    callback();
  }
}

export default EmojiMenuInModal;