From 9bbe405cd0999adabdda2265cacc02e33a6724fb Mon Sep 17 00:00:00 2001 From: Nick O'Leary Date: Tue, 3 Jul 2018 21:18:15 +0100 Subject: [PATCH] Do not show blank popovers --- editor/js/ui/common/popover.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/editor/js/ui/common/popover.js b/editor/js/ui/common/popover.js index d0253a8cc..4e2a0b0ef 100644 --- a/editor/js/ui/common/popover.js +++ b/editor/js/ui/common/popover.js @@ -48,12 +48,15 @@ RED.popover = (function() { var openPopup = function(instant) { if (active) { - div = $('
').appendTo("body"); + 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();