Commit e78d358b authored by Fatih Acet's avatar Fatih Acet

Merge branch '35530-teleporting-emoji-fix' into 'master'

Fix teleporting emoji (MR description instead of comment)

Closes #35530

See merge request gitlab-org/gitlab-ce!17100
parents e9802a83 85c93d89
...@@ -50,10 +50,8 @@ class AwardsHandler { ...@@ -50,10 +50,8 @@ class AwardsHandler {
this.registerEventListener('on', $('html'), 'click', (e) => { this.registerEventListener('on', $('html'), 'click', (e) => {
const $target = $(e.target); const $target = $(e.target);
if (!$target.closest('.emoji-menu-content').length) {
$('.js-awards-block.current').removeClass('current');
}
if (!$target.closest('.emoji-menu').length) { if (!$target.closest('.emoji-menu').length) {
$('.js-awards-block.current').removeClass('current');
if ($('.emoji-menu').is(':visible')) { if ($('.emoji-menu').is(':visible')) {
$('.js-add-award.is-active').removeClass('is-active'); $('.js-add-award.is-active').removeClass('is-active');
this.hideMenuElement($('.emoji-menu')); this.hideMenuElement($('.emoji-menu'));
......
---
title: Fix Teleporting Emoji
merge_request: 16963
author: Jared Deckard <jared.deckard@gmail.com>
type: fixed
...@@ -79,7 +79,7 @@ import '~/lib/utils/common_utils'; ...@@ -79,7 +79,7 @@ import '~/lib/utils/common_utils';
return expect($emojiMenu.length).toBe(1); return expect($emojiMenu.length).toBe(1);
}); });
}); });
return it('should remove emoji menu when body is clicked', function(done) { it('should remove emoji menu when body is clicked', function(done) {
$('.js-add-award').eq(0).click(); $('.js-add-award').eq(0).click();
return lazyAssert(done, function() { return lazyAssert(done, function() {
var $emojiMenu; var $emojiMenu;
...@@ -90,6 +90,17 @@ import '~/lib/utils/common_utils'; ...@@ -90,6 +90,17 @@ import '~/lib/utils/common_utils';
return expect($('.js-awards-block.current').length).toBe(0); return expect($('.js-awards-block.current').length).toBe(0);
}); });
}); });
it('should not remove emoji menu when search is clicked', function(done) {
$('.js-add-award').eq(0).click();
return lazyAssert(done, function() {
var $emojiMenu;
$emojiMenu = $('.emoji-menu');
$('.emoji-search').click();
expect($emojiMenu.length).toBe(1);
expect($emojiMenu.hasClass('is-visible')).toBe(true);
return expect($('.js-awards-block.current').length).toBe(1);
});
});
}); });
describe('::addAwardToEmojiBar', function() { describe('::addAwardToEmojiBar', function() {
it('should add emoji to votes block', function() { it('should add emoji to votes block', function() {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment