From fc1ce332de36ee2ce3a3c8b4b6c528f71ff2a824 Mon Sep 17 00:00:00 2001 From: Soufiane Date: Thu, 25 May 2023 16:01:36 +0200 Subject: [PATCH] Issue with scrollbar in smart annotation pop-up [SCI-8420] (#5479) * Fix issues in smart annotation pop-up - Initialize perfectScrollBar on the current atWho container. - Close AtWho pop-up when tinyMCE editor is closed. Co-authored-by: Sboursen * Fix hound [SCI-8420] Co-authored-by: Sboursen * Close smart annotation pop-up after tinyMCE save [SCI-8420] Co-authored-by: Sboursen --------- Co-authored-by: Sboursen --- app/assets/javascripts/sitewide/atwho_res.js | 8 ++------ app/javascript/packs/tiny_mce.js | 3 +++ 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/app/assets/javascripts/sitewide/atwho_res.js b/app/assets/javascripts/sitewide/atwho_res.js index ad11d28e5..d7511f934 100644 --- a/app/assets/javascripts/sitewide/atwho_res.js +++ b/app/assets/javascripts/sitewide/atwho_res.js @@ -82,9 +82,9 @@ var SmartAnnotation = (function() { $currentAtWho.find(`.repository-object[data-object-id="${data.repository}"]`) .addClass('btn-primary').removeClass('btn-light'); } - if ($('.atwho-scroll-container')[0]) { + if ($('.atwho-scroll-container').last()[0]) { // eslint-disable-next-line no-new - new PerfectScrollbar($('.atwho-scroll-container')[0]); + new PerfectScrollbar($('.atwho-scroll-container').last()[0]); } }); return true; @@ -220,10 +220,6 @@ var SmartAnnotation = (function() { displayTimeout: 120000 }) .atwho(atWhoSettings('#')); - // .atwho(atWhoSettings('task#', FilterTypeEnum.TASK)) Waiting for better times - // .atwho(atWhoSettings('project#', FilterTypeEnum.PROJECT)) - // .atwho(atWhoSettings('experiment#', FilterTypeEnum.EXPERIMENT)) - // .atwho(atWhoSettings('sample#', FilterTypeEnum.REPOSITORY)); $(this).data('atwho-initialized', true); } diff --git a/app/javascript/packs/tiny_mce.js b/app/javascript/packs/tiny_mce.js index 863454cb4..4f32ea178 100644 --- a/app/javascript/packs/tiny_mce.js +++ b/app/javascript/packs/tiny_mce.js @@ -323,6 +323,7 @@ window.TinyMCE = (() => { .on('click', (event) => { event.preventDefault(); saveAction(editor); + SmartAnnotation.closePopup(); }); // After save action @@ -371,6 +372,8 @@ window.TinyMCE = (() => { updateScrollPosition(editorForm); if (options.onSaveCallback) { options.onSaveCallback($(selector).val()); } + + SmartAnnotation.closePopup(); }) .removeClass('hidden');