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:
parent
c440a4c730
commit
9bbe405cd0
@ -48,12 +48,15 @@ RED.popover = (function() {
|
|||||||
|
|
||||||
var openPopup = function(instant) {
|
var openPopup = function(instant) {
|
||||||
if (active) {
|
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") {
|
if (size !== "default") {
|
||||||
div.addClass("red-ui-popover-size-"+size);
|
div.addClass("red-ui-popover-size-"+size);
|
||||||
}
|
}
|
||||||
if (typeof content === 'function') {
|
if (typeof content === 'function') {
|
||||||
var result = content.call(res);
|
var result = content.call(res);
|
||||||
|
if (result === null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (typeof result === 'string') {
|
if (typeof result === 'string') {
|
||||||
div.text(result);
|
div.text(result);
|
||||||
} else {
|
} else {
|
||||||
@ -65,7 +68,7 @@ RED.popover = (function() {
|
|||||||
if (width !== "auto") {
|
if (width !== "auto") {
|
||||||
div.width(width);
|
div.width(width);
|
||||||
}
|
}
|
||||||
|
div.appendTo("body");
|
||||||
|
|
||||||
var targetPos = target.offset();
|
var targetPos = target.offset();
|
||||||
var targetWidth = target.outerWidth();
|
var targetWidth = target.outerWidth();
|
||||||
|
Loading…
Reference in New Issue
Block a user