summernote-emoji icon indicating copy to clipboard operation
summernote-emoji copied to clipboard

emoji-menu be closed when click on emoji

Open s8990 opened this issue 6 years ago • 3 comments

i use summernote (tam-emoji.min.js). when choosing emoji, emoji menu be close BUT i want dont close emoji-menu . search in summernote site and githubs but cant find text that help me. please help me solve this problem .

BIG THANKS

s8990 avatar Oct 29 '18 07:10 s8990

you need to make changes in the script only, use "tam-emoji.js" and edit/replace following things:

Changes in click action when clicked anywhere on body:

$body.on('mouseup', function(e) { e = e.originalEvent || e; var target = e.target || window; if ($(target).hasClass('emoji-picker') || $(target).hasClass('emoji-menu-tab') || $(target).hasClass('emoji_ico')) { return; } self.$panel.hide(); });

For identifying click on emojis in function (createdEmojiIcon) add following class in "img" tag:

return '<img src="' + blankGifPath + '" class="img emoji_ico" style="' + style + '" alt="' + Config.htmlEntities(name) + '">'; };

anshulCoder avatar Nov 21 '18 10:11 anshulCoder

thanks @anshulCoder your solution works for me, but how do you keep emojis from being closed when I click scroll

aacassandra avatar Nov 30 '18 16:11 aacassandra

Inside addListener function insert. it worked very well.

$body.on('mouseup', '.mobile_scrollable_wrap', function (e) { //Impede o fechamento do Dropdown dos emojis caso interaja com a barra de rolagem. e.stopPropagation(); e.preventDefault(); });

ericfs1980 avatar May 24 '22 19:05 ericfs1980