You're listening for 'attachmentClicked'
events on your AttachmentView
:
bindEvents: (view) ->
@listenTo view, 'attachmentClicked', @attachmentClicked
but I don't see anything that will trigger such an event. Setting up some DOM event handlers in a view like this:
events:
'click' : 'attachmentClicked'
'dblclick' : 'openAttachment'
merely means that a click will trigger an attachmentClicked
call, it won't trigger an 'attachmentClicked'
Backbone event; if you want that event then you'll have to trigger it yourself:
attachmentClicked: ->
@$el.addClass('selectedAttachmentView')
@trigger 'attachmentClicked'