1 class Locmare.ProfilerModule.AssociationModule.HasOne extends Pettanr.View
\r
4 initialize: (options) ->
\r
5 @association = options.association
\r
6 @has_one_manifest = options.has_one_manifest
\r
8 controller = Manifest.manifest().controllers[@has_one_manifest.controller_name]
\r
9 action = controller.actions[@has_one_manifest.action_name]
\r
10 @list = Locmare.ListGroup.list(
\r
11 action.path_name(), action.name,
\r
12 {id: @item().get('id')}
\r
17 @list.open((page_status) =>
\r
25 this.$el.html(@filer.el)
\r
29 @filer = new Locmare.Filer({
\r
30 item_name: @has_one_model().item_name(),
\r
31 items: @list.items(),
\r
35 @listenTo(@filer, 'http_get', @http_get)
\r
36 @listenTo(@filer, 'pick', @pick)
\r
41 has_one_model: () ->
\r
42 @has_one_manifest.model()
\r
45 @association.profiler
\r
47 add_pick: (target_model) ->
\r
48 @list.open((page_status) =>
\r
51 @filer.add_pick(target_model)
\r
55 @trigger('http_get', url)
\r
58 @trigger('pick', item)
\r