diff --git a/app/assets/javascripts/comments.js.erb b/app/assets/javascripts/comments.js.erb index 8b8e0037b..8297c23f9 100644 --- a/app/assets/javascripts/comments.js.erb +++ b/app/assets/javascripts/comments.js.erb @@ -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 }); }); } diff --git a/app/assets/javascripts/projects/canvas.js.erb b/app/assets/javascripts/projects/canvas.js.erb index d4f524071..b4dded984 100644 --- a/app/assets/javascripts/projects/canvas.js.erb +++ b/app/assets/javascripts/projects/canvas.js.erb @@ -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() {