Position popover properly on a scrolled page

Not needed in the core editor, but needed in the docs pages that can scroll
This commit is contained in:
Nick O'Leary
2021-10-19 22:22:53 +01:00
parent 8d79deffb5
commit 7610353f07

View File

@@ -603,7 +603,7 @@ RED.popover = (function() {
var panelWidth = panel.width();
var top = (targetHeight+pos.top) + offset[1];
if (top+panelHeight > $(window).height()) {
if (top+panelHeight-$(document).scrollTop() > $(window).height()) {
top -= (top+panelHeight)-$(window).height() + 5;
}
if (top < 0) {