1 class Pettanr.View.Show.Header extends Pettanr.View
\r
3 className: 'show-header'
\r
5 constructor: (@item, @context, options) ->
\r
8 initialize: (options) ->
\r
9 @face_options = options.face
\r
10 @label_options = options.label
\r
11 @prof_options = options.prof
\r
13 @face_options.context ||= @context
\r
14 @face_options.class_name ||= 'face'
\r
15 @face_options.click ||= () =>
\r
16 @trigger('click:face')
\r
18 @label_options.context ||= @context
\r
19 @label_options.class_name ||= 'label'
\r
20 @label_options.click ||= () =>
\r
21 @trigger('click:label')
\r
23 @prof_options.context ||= @context
\r
24 @prof_options.class_name ||= 'prof'
\r
25 @prof_options.click ||= () =>
\r
26 @trigger('click:prof')
\r
29 @face_button = @item.mini_face_button(@face_options)
\r
30 @label_button = @item.label_button(@label_options)
\r
31 @prof_button = @item.mini_prof_button(@prof_options)
\r
35 this.$el.append(@pick.render().el) if @pick
\r
36 this.$el.append(@face_button.render().el)
\r
37 this.$el.append(@label_button.render().el)
\r
38 this.$el.append(@prof_button.render().el)
\r
41 add_pick: (target_model) ->
\r
42 @pick = new Pettanr.View.MiniPick(target_model.pick_type(@item.item_name()), {
\r
45 @trigger('click:pick')
\r