From ecc97336233ceb05a5590ab52b7b2f0a8a8ddd16 Mon Sep 17 00:00:00 2001 From: Stephen Abello Date: Wed, 17 Mar 2021 17:33:45 +0100 Subject: [PATCH] =?UTF-8?q?N=C2=B03530=20Correctly=20place=20the=20popup?= =?UTF-8?q?=20and=20limit=20its=20height?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- css/backoffice/components/_newsroom-menu.scss | 3 ++- js/components/newsroom-menu.js | 6 ++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/css/backoffice/components/_newsroom-menu.scss b/css/backoffice/components/_newsroom-menu.scss index 10b8d2b20..7e2554c0e 100644 --- a/css/backoffice/components/_newsroom-menu.scss +++ b/css/backoffice/components/_newsroom-menu.scss @@ -50,12 +50,13 @@ $ibo-popover-menu--item--no-message--image--svg--padding : 15px !default; flex-flow: column; min-width: $ibo-navigation-menu--notifications-menu--min-width; .ibo-navigation-menu--notifications--messages-section{ - overflow-x: auto; + overflow: auto; } } .ibo-navigation-menu--notifications--show-all-messages, .ibo-navigation-menu--notifications-dismiss-all, .ibo-navigation-menu--notifications-show-all-multiple{ overflow-x: inherit; text-align: center; + min-height: 45px; } .ibo-navigation-menu--notifications--item--image{ diff --git a/js/components/newsroom-menu.js b/js/components/newsroom-menu.js index e716a4ed3..d789a86d6 100644 --- a/js/components/newsroom-menu.js +++ b/js/components/newsroom-menu.js @@ -44,11 +44,13 @@ $(function() $(this.js_selectors.menu_toggler).on('click', function(oEvent) { var oEventTarget = $(oEvent.target); var aEventTargetPos = oEventTarget.position(); + var aEventTargetOffset = oEventTarget.offset(); + $iHeight = Math.abs(aEventTargetOffset.top - 100); $(me.element).css({ - 'top': (aEventTargetPos.top + parseInt(oEventTarget.css('marginTop'), 10) - $(me.element).height()) + 'px', + 'max-height': $iHeight + 'px', + 'top': (aEventTargetPos.top + parseInt(oEventTarget.css('marginTop'), 10) - Math.min($(me.element).height(), $iHeight)) + 'px', 'left': (aEventTargetPos.left + parseInt(oEventTarget.css('marginLeft'), 10) + oEventTarget.width()) + 'px', - 'max-height' : (aEventTargetPos.top + parseInt(oEventTarget.css('marginTop'), 10) - 100) + 'px' }); $(me.element).popover_menu("togglePopup"); });