mirror of
https://github.com/fergalmoran/dss.git
synced 2026-02-15 04:23:58 +00:00
36 lines
1.1 KiB
CoffeeScript
Executable File
36 lines
1.1 KiB
CoffeeScript
Executable File
define ['marionette', 'models/comment/commentItem', 'views/comment/commentItemView', 'text!/tpl/CommentListView'],
|
|
(Marionette, CommentItem, CommentItemView, Template) ->
|
|
class CommentListView extends Marionette.CompositeView
|
|
|
|
template: _.template(Template)
|
|
tagName: "ul"
|
|
className: "activity-listing media-list"
|
|
itemView: CommentItemView
|
|
itemViewContainer: "#comment-list-container"
|
|
|
|
ui:
|
|
commentText: '#comment-text'
|
|
|
|
events:
|
|
"click #btn-add-comment": "addComment"
|
|
|
|
addComment: ->
|
|
console.log "CommentListView: addComment"
|
|
@collection.create
|
|
mix_id: @collection.mix.get("id")
|
|
comment: @ui.commentText.val()
|
|
,
|
|
success: (newItem) =>
|
|
@ui.commentText.val ""
|
|
true
|
|
|
|
error: (a, b, c) ->
|
|
console.log a
|
|
console.log b
|
|
console.log c
|
|
true
|
|
|
|
true
|
|
|
|
CommentListView
|