Fix comment menu position on canvas [SCI-3174]

This commit is contained in:
Oleksii Kriuchykhin 2019-04-02 12:54:21 +02:00
parent daaa6a367b
commit 91a87cbf3a
2 changed files with 9 additions and 1 deletions

View file

@ -209,6 +209,8 @@ var Comments = (function() {
var offset = useParentOffset ? $el.offset().top : $el.position().top;
$el.find('.dropdown-menu-fixed')
.offset({ top: (offset + <%= Constants::DROPDOWN_TOP_OFFSET_PX %>) });
$el.find('.dropdown-menu-fixed')
.position({ top: $el.position().top });
});
}

View file

@ -317,9 +317,15 @@ function initializeFullZoom() {
restoreDraggablePosition($("#diagram"), $("#canvas-container"));
// Initialize comments
Comments.initCommentOptions("ul.content-comments", false);
Comments.initCommentOptions("ul.content-comments", true);
Comments.initEditComments(".panel.module-large .tab-content");
Comments.initDeleteComments(".panel.module-large .tab-content");
$('#diagram-container').on('shown.bs.dropdown', '.dropdown-comment', function() {
var commentMenu = $(this).find('.dropdown-menu-fixed');
commentMenu.position({ top: $(this).parent().position().top });
commentMenu.offset({ top: $(this).parent().offset().top + <%= Constants::DROPDOWN_TOP_OFFSET_PX %> });
});
}
function destroyFullZoom() {