1 class Pettanr.View.Summary.Leaf extends Pettanr.View
\r
3 initialize: (options) ->
\r
6 @binder = new Pettanr.View.Summary.Leaf.Binder(@item, {})
\r
7 @destination = new Pettanr.View.Summary.Leaf.Binder(@item, options.destination_item_name, {})
\r
11 @listenTo(this, 'load_binder', @load_destination)
\r
12 @listenTo(this, 'load_destination', @ready)
\r
20 load_destination: () ->
\r
21 @item.get_parent(@destination_item_name, this, {
\r
22 success: (@destination) =>
\r
23 @destination_icon = @destination.icon_view(true)
\r
24 @listenTo(@destination_icon, 'click', @destination_click)
\r
25 @destination.get_parent('author', this, {
\r
26 success: (@destination_author) =>
\r
27 @destination_author_mini_faced_label = @destination_author.mini_faced_label({
\r
30 @trigger('http_get', @destination_author.show_url())
\r
32 this.$el.append(@destination_author_mini_faced_label.render().el)
\r
33 @trigger('load_destination')
\r
39 this.$el.append(@binder_author_mini_faced_label.render().el)
\r
40 this.$el.append(@destination_author_mini_faced_label.render().el)
\r
44 @trigger('http_get', @binder_icon.url())
\r
46 destination_click: () ->
\r
47 @trigger('http_get', @destination_icon.url())
\r
49 binder_author_click: () ->
\r
50 @trigger('http_get', @binder_author_icon_with_caption.url())
\r
52 destination_author_click: () ->
\r
53 @trigger('http_get', @destination_author_icon_with_caption.url())
\r
55 class Pettanr.View.Summary.Leaf.Binder extends Tag.Span
\r
57 constructor: (@item, @binder_item_name, options) ->
\r
59 @binder_model = @item.my_class().binder_model()
\r
61 initialize: (options) ->
\r
62 @item.get_parent(@binder_model.item_name(), this, {
\r
63 success: (@binder) =>
\r
64 @face_button = @binder.mini_face_button(true)
\r
65 @binder.get_parent('author', this, {
\r
66 success: (@author) =>
\r
67 @author_mini_faced_label = @author.mini_faced_label({
\r
70 @trigger('http_get', @author.show_url())
\r
72 this.$el.append(@author_mini_faced_label.render().el)
\r
73 @trigger('load_binder')
\r