|
|
@ -166,6 +166,11 @@ function EmojiTooltip (btnEl, options) { |
|
|
|
} |
|
|
|
} |
|
|
|
return cancelEvent(e); |
|
|
|
return cancelEvent(e); |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
$(document).on('mousedown', function (e) { |
|
|
|
|
|
|
|
if (self.shown) { |
|
|
|
|
|
|
|
self.hide(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
EmojiTooltip.prototype.onMouseEnter = function (triggerShow) { |
|
|
|
EmojiTooltip.prototype.onMouseEnter = function (triggerShow) { |
|
|
@ -191,6 +196,21 @@ EmojiTooltip.prototype.onMouseLeave = function (triggerUnshow) { |
|
|
|
} |
|
|
|
} |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
EmojiTooltip.prototype.getScrollWidth = function() { |
|
|
|
|
|
|
|
var outer = $('<div>').css({ |
|
|
|
|
|
|
|
position: 'absolute', |
|
|
|
|
|
|
|
width: 100, |
|
|
|
|
|
|
|
height: 100, |
|
|
|
|
|
|
|
overflow: 'scroll', |
|
|
|
|
|
|
|
top: -9999 |
|
|
|
|
|
|
|
}).appendTo($(document.body)); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var scrollbarWidth = outer[0].offsetWidth - outer[0].clientWidth; |
|
|
|
|
|
|
|
outer.remove(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return scrollbarWidth; |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
EmojiTooltip.prototype.createTooltip = function () { |
|
|
|
EmojiTooltip.prototype.createTooltip = function () { |
|
|
@ -207,6 +227,13 @@ EmojiTooltip.prototype.createTooltip = function () { |
|
|
|
this.footerEl = $('.composer_emoji_tooltip_footer', this.tooltip); |
|
|
|
this.footerEl = $('.composer_emoji_tooltip_footer', this.tooltip); |
|
|
|
this.settingsEl = $('.composer_emoji_tooltip_settings', this.tooltip); |
|
|
|
this.settingsEl = $('.composer_emoji_tooltip_settings', this.tooltip); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var scrollWidth = this.getScrollWidth(); |
|
|
|
|
|
|
|
if (scrollWidth > 0) { |
|
|
|
|
|
|
|
this.tooltipEl.css({ |
|
|
|
|
|
|
|
width: parseInt(this.tooltipEl.css('width')) + scrollWidth |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
angular.forEach(['recent', 'smile', 'flower', 'bell', 'car', 'grid', 'stickers'], function (tabName, tabIndex) { |
|
|
|
angular.forEach(['recent', 'smile', 'flower', 'bell', 'car', 'grid', 'stickers'], function (tabName, tabIndex) { |
|
|
|
var tab = $('<a class="composer_emoji_tooltip_tab composer_emoji_tooltip_tab_' + tabName + '"></a>') |
|
|
|
var tab = $('<a class="composer_emoji_tooltip_tab composer_emoji_tooltip_tab_' + tabName + '"></a>') |
|
|
|
.on('mousedown', function (e) { |
|
|
|
.on('mousedown', function (e) { |
|
|
@ -363,8 +390,10 @@ EmojiTooltip.prototype.show = function () { |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
EmojiTooltip.prototype.hide = function () { |
|
|
|
EmojiTooltip.prototype.hide = function () { |
|
|
|
|
|
|
|
if (this.tooltipEl) { |
|
|
|
this.tooltipEl.removeClass('composer_emoji_tooltip_shown'); |
|
|
|
this.tooltipEl.removeClass('composer_emoji_tooltip_shown'); |
|
|
|
this.btnEl.removeClass('composer_emoji_insert_btn_on'); |
|
|
|
this.btnEl.removeClass('composer_emoji_insert_btn_on'); |
|
|
|
|
|
|
|
} |
|
|
|
delete this.hideTimeout; |
|
|
|
delete this.hideTimeout; |
|
|
|
delete this.shown; |
|
|
|
delete this.shown; |
|
|
|
}; |
|
|
|
}; |
|
|
|