Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Once you've added the trigger, you will need to create a new instance of LIVECHATSDK.LIVECHAT.emojiPicker EmojiButton object class.

Code Block
languagejs
LIVECHATSDK.SDK.getEmojiPicker().then (
  function(emojiClass) { 
    window.emoji_picker = new LIVECHATSDKemojiClass.LIVECHAT.emojiPicker(EmojiButton(
      {
        "position": "auto",
        "showPreview": false,
        "recentsCount": 6,
        "autoHide": false,
        "showVariants": false,
        "autoFocusSearch": true,
        "emojiSize": "1.2em",
        "emojisPerRow": 6,
        "emojiVersion": "11.0",
        "categories": ["smileys", "people", "animals", "food", "activities", "travel", "objects", "symbols"],
        "zIndex": 10000,
        "showAnimation": true
      }
    );  
  }
);

After constructing a picker, it can be shown by calling showPicker or togglePicker methods. These functions expect a reference element as a parameter. The picker is positioned relative to this reference element according the “position” parameter.

You can also use a static positioning by specifying x/y coordinates in the constructor options parameters.

Code Block
languagejs
jQuery("#btnEmoji").off().on("click", function() {
  if ( window.emoji_picker.pickerVisible == true) {
    window.emoji_picker.hidePicker();
  } else {
    window.emoji_picker.showPicker( jQuery("#btnEmoji").get() );
  }
});

...