From 37cff75013ccfd7d45e62e0edb04790b8d6df399 Mon Sep 17 00:00:00 2001 From: Oleksii Kriuchykhin Date: Tue, 11 Oct 2016 15:00:59 +0200 Subject: [PATCH] Fixes issue with comments options menu [SCI-530] --- app/assets/javascripts/comments.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/app/assets/javascripts/comments.js b/app/assets/javascripts/comments.js index 681dc0dc3..52c8e094f 100644 --- a/app/assets/javascripts/comments.js +++ b/app/assets/javascripts/comments.js @@ -165,7 +165,7 @@ var Comments = (function() { } function initCommentOptions(scrollableContainer, useParentOffset) { - if ( ! _.isUndefined(typeof useParentOffset) ) { + if ( ! _.isUndefined(useParentOffset) ) { useParentOffset = useParentOffset; } else { useParentOffset = true; @@ -179,8 +179,10 @@ var Comments = (function() { var $el = $(this); var menu = $el.find('.dropdown-menu'); var leftPos = $el.offset().left; + var parentTopPos = $el.offset().top; if (leftPos + menu.width() > $(window).width()) { - menu.offset({ left: leftPos - menu.width() }); + menu.offset({ left: leftPos - menu.width(), + top: (parentTopPos + 20)}); } }); } @@ -197,7 +199,7 @@ var Comments = (function() { } function scrollCommentOptions(selector, useParentOffset) { - if ( ! _.isUndefined(typeof useParentOffset) ) { + if ( ! _.isUndefined(useParentOffset) ) { useParentOffset = useParentOffset; } else { useParentOffset = true;