mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-01-23 16:27:06 +08:00
Merge pull request #2556 from aignatov-bio/ai-sci-4515-fix-smart-annotation-position
Fix smart annotation position for horizontal scroll [SCI-4515]
This commit is contained in:
commit
99e1affa73
1 changed files with 9 additions and 2 deletions
|
@ -381,8 +381,15 @@ var SmartAnnotation = (function() {
|
|||
function init() {
|
||||
$(field)
|
||||
.on("reposition.atwho", function(event, flag, query) {
|
||||
if (query.$inputor.offset().left > $(window).width()) {
|
||||
query.$el.find('.atwho-view').css('left', (flag.left + $(window).scrollLeft()) + 'px');
|
||||
let inputFieldLeft = query.$inputor.offset().left;
|
||||
if (inputFieldLeft > $(window).width()) {
|
||||
let leftPosition;
|
||||
if (inputFieldLeft < flag.left + $(window).scrollLeft()) {
|
||||
leftPosition = inputFieldLeft;
|
||||
} else {
|
||||
leftPosition = flag.left + $(window).scrollLeft();
|
||||
}
|
||||
query.$el.find('.atwho-view').css('left', leftPosition + 'px');
|
||||
}
|
||||
if ($('.repository-show').length) {
|
||||
query.$el.find('.atwho-view').css('top', flag.top + 'px');
|
||||
|
|
Loading…
Reference in a new issue