1 class Pettanr.View.Summary.Leaf extends Pettanr.View
\r
3 initialize: (options) ->
\r
6 @binder_item_name = options.binder_item_name
\r
7 @destination_item_name = options.destination_item_name
\r
8 @binder_view = new Tag.Span({})
\r
9 @destination_view = new Tag.Span({})
\r
13 @listenTo(this, 'load_binder', @load_destination)
\r
14 @listenTo(this, 'load_destination', @ready)
\r
21 @item.get_parent(@binder_item_name, this, {
\r
22 success: (@binder) =>
\r
23 @binder_icon = @binder.icon_view(true)
\r
24 @listenTo(@binder_icon, 'click', @binder_click)
\r
25 @binder.get_parent('author', this, {
\r
26 success: (@binder_author) =>
\r
27 @binder_author_icon_with_caption = @binder_author.icon_with_caption_view(true, 'name', 12)
\r
28 @listenTo(@binder_author_icon_with_caption, 'click', @binder_author_click)
\r
29 @binder_view.$el.append(@binder_icon.render().el)
\r
30 @binder_view.$el.append(@binder_author_icon_with_caption.render().el)
\r
31 @trigger('load_binder')
\r
35 load_destination: () ->
\r
36 @item.get_parent(@destination_item_name, this, {
\r
37 success: (@destination) =>
\r
38 @destination_icon = @destination.icon_view(true)
\r
39 @listenTo(@destination_icon, 'click', @destination_click)
\r
40 @destination.get_parent('author', this, {
\r
41 success: (@destination_author) =>
\r
42 @destination_author_icon_with_caption = @destination_author.icon_with_caption_view(true, 'name', 12)
\r
43 @listenTo(@destination_author_icon_with_caption, 'click', @destination_author_click)
\r
44 @destination_view.$el.append(@destination_icon.render().el)
\r
45 @destination_view.$el.append(@destination_author_icon_with_caption.render().el)
\r
46 @trigger('load_destination')
\r
52 this.$el.append(@binder_view.render().el)
\r
53 this.$el.append(@destination_view.render().el)
\r
57 @trigger('http_get', @binder_icon.url())
\r
59 destination_click: () ->
\r
60 @trigger('http_get', @destination_icon.url())
\r
62 binder_author_click: () ->
\r
63 @trigger('http_get', @binder_author_icon_with_caption.url())
\r
65 destination_author_click: () ->
\r
66 @trigger('http_get', @destination_author_icon_with_caption.url())
\r