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

Do not show blank popovers

This commit is contained in:
Nick O'Leary 2018-07-03 21:18:15 +01:00
parent c440a4c730
commit 9bbe405cd0
No known key found for this signature in database
GPG Key ID: 4F2157149161A6C9

View File

@ -48,12 +48,15 @@ RED.popover = (function() {
var openPopup = function(instant) {
if (active) {
div = $('<div class="red-ui-popover red-ui-popover-'+direction+'"></div>').appendTo("body");
div = $('<div class="red-ui-popover red-ui-popover-'+direction+'"></div>');
if (size !== "default") {
div.addClass("red-ui-popover-size-"+size);
}
if (typeof content === 'function') {
var result = content.call(res);
if (result === null) {
return;
}
if (typeof result === 'string') {
div.text(result);
} else {
@ -65,7 +68,7 @@ RED.popover = (function() {
if (width !== "auto") {
div.width(width);
}
div.appendTo("body");
var targetPos = target.offset();
var targetWidth = target.outerWidth();