From 6003b8824fdcba0d59db6681282c7d2d7f2bae1c Mon Sep 17 00:00:00 2001 From: =?utf8?q?Aleksander=20=C5=81ukasz?= Date: Thu, 29 May 2014 14:32:23 +0200 Subject: [PATCH 1/1] editor: Hide comment header if there is nothing to show in it --- .../documentCanvas/canvas/comments/comment.html | 10 ++++++---- .../modules/documentCanvas/canvas/comments/comments.js | 4 ++-- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/editor/modules/documentCanvas/canvas/comments/comment.html b/src/editor/modules/documentCanvas/canvas/comments/comment.html index 3e9fb28..ca15b77 100644 --- a/src/editor/modules/documentCanvas/canvas/comments/comment.html +++ b/src/editor/modules/documentCanvas/canvas/comments/comment.html @@ -1,8 +1,10 @@
-
- <%= author %> - <%= date %> -
+ <% if(author || date) { %> +
+ <%= author %> + <%= date %> +
+ <% } %>
<%= content %> diff --git a/src/editor/modules/documentCanvas/canvas/comments/comments.js b/src/editor/modules/documentCanvas/canvas/comments/comments.js index 3076f52..65c80f2 100644 --- a/src/editor/modules/documentCanvas/canvas/comments/comments.js +++ b/src/editor/modules/documentCanvas/canvas/comments/comments.js @@ -142,8 +142,8 @@ var CommentView = function(commentNode) { }, 'date'); this.dom = $(_.template(commentTemplate)({ - author: author ||'?', - date: date || '?', + author: author || '', + date: date || '', content: this.node.object.getText() || '?' })); -- 2.20.1