Commit b9f7bb70d0cd5548eea74bf110b18a90230c2e96

  • avatar
  • arvind
  • Wed Mar 05 21:32:34 IST 2014
Code refactor. Fixing issues with saving a reply.
app.js
(6 / 3)
  
1818 };
1919 },
2020 initialize: function() {
21 },
22 isValid: function() {
23 return true;
2124 }
2225 });
2326 var Comment = Backbone.Model.extend({
111111 render: function() {
112112 if(this.model.get('how').get('comment').length) {
113113 if(this.model.get('how').get('replyTo').length) {
114 var item = '#' + this.model.get('how')['replyTo'];
114 var item = '#' + this.model.get('how').get('replyTo');
115115 var el = $(item).parent();
116116 $(el).append(this.template(this.model.toJSON()));
117117 }
185185
186186 },
187187 showOne: function(model) {
188 if(model.get('how').isNew === undefined) {
189 console.log(model);
188 if(model.get('how').isValid === undefined) {
190189 model.set({'how': new How(model.get('how'))});
190 console.log(model);
191191 }
192192 var view = new CommentView({model:model});
193193 $(this.el).append(view.render().el);