From 429ae1e23517d82c022fc66df26b05c9da7f8b5e Mon Sep 17 00:00:00 2001 From: arno Date: Sat, 14 Aug 2010 23:39:16 +0200 Subject: [PATCH] fixes incompatibility between div messenger and closebtn --- public/js/utils.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/public/js/utils.js b/public/js/utils.js index 588a85b..d59a112 100644 --- a/public/js/utils.js +++ b/public/js/utils.js @@ -311,9 +311,13 @@ Element.addMethods('div', { addMessage: function(div, message) { var node = (div.ownerDocument || document).createTextNode(message); - if (!div.empty()) { + + if ($A(div.childNodes).filter(function(node) { + return (node.nodeType === 3 || node.tagName.toLowerCase() === 'br'); + }).length) { div.insert(new Element('br')); } + div.appendChild(node); return div.show(); }, -- 2.39.2