From: Aleksander Ɓukasz Date: Thu, 29 May 2014 12:32:23 +0000 (+0200) Subject: editor: Hide comment header if there is nothing to show in it X-Git-Url: https://git.mdrn.pl/fnpeditor.git/commitdiff_plain/6003b8824fdcba0d59db6681282c7d2d7f2bae1c?ds=sidebyside;hp=0c57fd826a58a217f499b5084c837fb8ef3f6d4f editor: Hide comment header if there is nothing to show in it --- 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() || '?' }));