1
0
mirror of https://github.com/node-red/node-red.git synced 2023-10-10 13:36:53 +02:00

fix unexpected line break of sidebar tab name popover

This commit is contained in:
Hiroyasu Nishiyama 2020-10-07 09:57:34 +09:00
parent 5e63471983
commit 13f046f310

View File

@ -84,6 +84,7 @@ RED.popover = (function() {
var targetHeight = target.outerHeight(); var targetHeight = target.outerHeight();
var divHeight = div.height(); var divHeight = div.height();
var divWidth = div.width(); var divWidth = div.width();
var paddingRight = 10;
var viewportTop = $(window).scrollTop(); var viewportTop = $(window).scrollTop();
var viewportLeft = $(window).scrollLeft(); var viewportLeft = $(window).scrollLeft();
@ -105,7 +106,7 @@ RED.popover = (function() {
d = "right"; d = "right";
top = targetPos.top+targetHeight/2-divHeight/2-deltaSizes[size].top; top = targetPos.top+targetHeight/2-divHeight/2-deltaSizes[size].top;
left = targetPos.left+targetWidth+deltaSizes[size].leftRight; left = targetPos.left+targetWidth+deltaSizes[size].leftRight;
} else if (left+divWidth > viewportRight) { } else if (left+divWidth+paddingRight > viewportRight) {
d = "left"; d = "left";
top = targetPos.top+targetHeight/2-divHeight/2-deltaSizes[size].top; top = targetPos.top+targetHeight/2-divHeight/2-deltaSizes[size].top;
left = targetPos.left-deltaSizes[size].leftLeft-divWidth; left = targetPos.left-deltaSizes[size].leftLeft-divWidth;