From e08ae04e47a371fcc83fdcd3b06a174780d9f903 Mon Sep 17 00:00:00 2001 From: Igor Zhukov Date: Wed, 20 Apr 2016 21:03:27 +0300 Subject: [PATCH] Fixed send inline sticker --- app/js/message_composer.js | 11 ++++++++--- app/js/services.js | 2 +- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/app/js/message_composer.js b/app/js/message_composer.js index b88f4679..e8a8f6bb 100644 --- a/app/js/message_composer.js +++ b/app/js/message_composer.js @@ -744,10 +744,15 @@ MessageComposer.prototype.setUpAutoComplete = function () { var self = this; this.autoCompleteEl.on('mousedown', function (e) { e = e.originalEvent || e; - var target = $(e.target), mention, code, command, inlineID; - if (target[0].tagName != 'A') { - target = $(target[0].parentNode); + var target = e.target; + var mention, code, command, inlineID; + while (target && target.tagName != 'A') { + target = target.parentNode; + } + if (!target) { + return cancelEvent(e); } + target = $(target); if (code = target.attr('data-code')) { if (self.onEmojiSelected) { self.onEmojiSelected(code, true); diff --git a/app/js/services.js b/app/js/services.js index c09c275d..84fbf526 100755 --- a/app/js/services.js +++ b/app/js/services.js @@ -1983,7 +1983,7 @@ angular.module('myApp.services', ['myApp.i18n', 'izhukov.utils']) $timeout(function () { delete historyDoc.progress; }); - console.log('file save done'); + // console.log('file save done'); }, function (e) { console.log('document download failed', e); historyDoc.progress.enabled = false;