Permalink
Browse files

fix message detail

  • Loading branch information...
1 parent cf6ae68 commit a9f5eacaa583bf12aa245fd00e90fbd002cbc575 @dbecher dbecher committed Mar 7, 2013
Showing with 8 additions and 3 deletions.
  1. +5 −2 js/app.js
  2. +2 −0 js/templates.js
  3. +1 −1 templates/message.html
View
@@ -6,7 +6,7 @@
var ChatList = BaseView.extend({
collection: new MessageCollection(),
- title: 'Chat',
+ title: 'Chatter',
rightBarButtons: [
{ html: '<button class="barButton">Settings</button>', click: 'settings' }
],
@@ -112,7 +112,10 @@
],
render: function() {
- this.$el.html(Templates.message(this.model.toJSON()));
+ this.$el.html(Templates.message(_.extend(this.model.toJSON(), {
+ cid: this.model.cid,
+ date: new Date(this.model.get('timestamp'))
+ })));
},
done: function() {
View
@@ -23,6 +23,8 @@ __p+='\n '+
((__t=( data.date.getMinutes() ))==null?'':__t)+
'\n</p>\n<li class="chat-message '+
((__t=( (data.mine ? 'chat-message-mine' : '') ))==null?'':__t)+
+'" data-message-id="'+
+((__t=( data.cid ))==null?'':__t)+
'" >\n <h3 class="chat-message-user" >'+
((__t=( data.user ))==null?'':__t)+
'</h3>\n <p class="chat-message-text">'+
View
@@ -7,7 +7,7 @@
<% } %>
<%= data.date.getHours() %>:<%= data.date.getMinutes() %>
</p>
-<li class="chat-message <%= (data.mine ? 'chat-message-mine' : '') %>" >
+<li class="chat-message <%= (data.mine ? 'chat-message-mine' : '') %>" data-message-id="<%= data.cid %>" >
<h3 class="chat-message-user" ><%= data.user %></h3>
<p class="chat-message-text"><%= data.body %></p>
</li>

0 comments on commit a9f5eac

Please sign in to comment.