editor: Hide comment header if there is nothing to show in it
authorAleksander Łukasz <aleksander.lukasz@nowoczesnapolska.org.pl>
Thu, 29 May 2014 12:32:23 +0000 (14:32 +0200)
committerAleksander Łukasz <aleksander.lukasz@nowoczesnapolska.org.pl>
Thu, 29 May 2014 12:32:23 +0000 (14:32 +0200)
src/editor/modules/documentCanvas/canvas/comments/comment.html
src/editor/modules/documentCanvas/canvas/comments/comments.js

index 3e9fb28..ca15b77 100644 (file)
@@ -1,8 +1,10 @@
 <div class="comment">
 <div class="comment">
-    <div class="header">
-        <span class="author"><%= author %></span>
-        <span class="date"><%= date %></span>
-    </div>
+    <% if(author || date) { %>
+        <div class="header">
+            <span class="author"><%= author %></span>
+            <span class="date"><%= date %></span>
+        </div>
+    <% } %>
     <div style="clear: both"></div>
     <div class="content">
         <%= content %>
     <div style="clear: both"></div>
     <div class="content">
         <%= content %>
index 3076f52..65c80f2 100644 (file)
@@ -142,8 +142,8 @@ var CommentView = function(commentNode) {
     }, 'date');
 
     this.dom = $(_.template(commentTemplate)({
     }, 'date');
 
     this.dom = $(_.template(commentTemplate)({
-        author: author ||'?',
-        date: date || '?',
+        author: author || '',
+        date: date || '',
         content: this.node.object.getText() || '?'
     }));
 
         content: this.node.object.getText() || '?'
     }));