Parse the template before binding render to an event

This commit is contained in:
lilia 2014-07-22 21:06:55 -10:00
parent d615a5a18b
commit 6ff6ef07a9
1 changed files with 5 additions and 2 deletions

View File

@ -9,10 +9,13 @@ var Whisper = Whisper || {};
initialize: function() {
this.$el.addClass(this.model.get('type'));
this.listenTo(this.model, 'change', this.render); // auto update
this.listenTo(this.model, 'destroy', this.remove); // auto update
this.template = $('#message').html();
Mustache.parse(this.template);
this.listenTo(this.model, 'change', this.render); // auto update
this.listenTo(this.model, 'destroy', this.remove); // auto update
},
render: function() {