From faae581f8b54b9cd3000d3060c446ed7dfe13447 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Aleksander=20=C5=81ukasz?= Date: Tue, 16 Jul 2013 11:45:47 +0200 Subject: [PATCH 1/1] Better representation o an empty text element in familyTree --- modules/nodeFamilyTree/nodeFamilyTree.js | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/modules/nodeFamilyTree/nodeFamilyTree.js b/modules/nodeFamilyTree/nodeFamilyTree.js index e47821e..af5d4d7 100644 --- a/modules/nodeFamilyTree/nodeFamilyTree.js +++ b/modules/nodeFamilyTree/nodeFamilyTree.js @@ -48,9 +48,15 @@ return function(sandbox) { nodeChildren.forEach(function(child) { if(child.getText) { var text = child.getText(); - if(text.length > 13) - text = text.substr(0,13) + '...'; - children.push({repr: '"' + text + '"', bold: child.sameNode(textElement)}); + if(!text) + text = '<pusty tekst>'; + else { + if(text.length > 13) { + text = text.substr(0,13) + '...'; + } + text = '"' + text + '"'; + } + children.push({repr: text, bold: child.sameNode(textElement)}); } else { children.push({repr: child.getWlxmlTag() + (child.getWlxmlClass() ? ' / ' + child.getWlxmlClass() : '')}); } -- 2.20.1