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 <dev.sboursen@gmail.com>

* Fix hound [SCI-8420]

Co-authored-by: Sboursen <dev.sboursen@gmail.com>

* Close smart annotation pop-up after tinyMCE save [SCI-8420]

Co-authored-by: Sboursen <dev.sboursen@gmail.com>

---------

Co-authored-by: Sboursen <dev.sboursen@gmail.com>
This commit is contained in:
Soufiane 2023-05-25 16:01:36 +02:00 committed by GitHub
parent b1a891e310
commit fc1ce332de
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 6 deletions

View file

@ -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);
}

View file

@ -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');