Commit b9f7bb70d0cd5548eea74bf110b18a90230c2e96
- Diff rendering mode:
- inline
- side by side
app.js
(6 / 3)
  | |||
18 | 18 | }; | |
19 | 19 | }, | |
20 | 20 | initialize: function() { | |
21 | }, | ||
22 | isValid: function() { | ||
23 | return true; | ||
21 | 24 | } | |
22 | 25 | }); | |
23 | 26 | var Comment = Backbone.Model.extend({ | |
… | … | ||
111 | 111 | render: function() { | |
112 | 112 | if(this.model.get('how').get('comment').length) { | |
113 | 113 | 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'); | ||
115 | 115 | var el = $(item).parent(); | |
116 | 116 | $(el).append(this.template(this.model.toJSON())); | |
117 | 117 | } | |
… | … | ||
185 | 185 | ||
186 | 186 | }, | |
187 | 187 | showOne: function(model) { | |
188 | if(model.get('how').isNew === undefined) { | ||
189 | console.log(model); | ||
188 | if(model.get('how').isValid === undefined) { | ||
190 | 189 | model.set({'how': new How(model.get('how'))}); | |
190 | console.log(model); | ||
191 | 191 | } | |
192 | 192 | var view = new CommentView({model:model}); | |
193 | 193 | $(this.el).append(view.render().el); |