Skip to content

Commit

Permalink
[BUGFIX] Prevent crash of dialog in case of selecting space between e…
Browse files Browse the repository at this point in the history
…mojis
  • Loading branch information
hbraune committed Feb 11, 2017
1 parent 0f7b582 commit efccd05
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions dialogs/emojione.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,11 @@ CKEDITOR.dialog.add( 'emojioneDialog', function( editor ) {
var dialog;
var onClick = function( evt ) {
var target = evt.data.getTarget();
editor.insertText(emojione.convert(target.getAttribute('data-unicode')));
dialog.hide();
var unicode = target.getAttribute('data-unicode');
if (unicode) {
editor.insertText(emojione.convert(target.getAttribute('data-unicode')));
dialog.hide();
}
evt.data.preventDefault();
};

Expand Down Expand Up @@ -169,7 +172,7 @@ CKEDITOR.dialog.add( 'emojioneDialog', function( editor ) {

return {
title: 'Emojis',
minWidth: 400,
minWidth: 550,
minHeight: 200,
contents: [
{
Expand Down

0 comments on commit efccd05

Please sign in to comment.