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 = action.find({id: @item().get('id')})
\r
15 success: (page_status) =>
\r
23 this.$el.html(@filer.el)
\r
27 @filer = new Locmare.Filer({
\r
28 item_name: @has_one_model().item_name(),
\r
29 items: @list.items(),
\r
33 @listenTo(@filer, 'http_get', @http_get)
\r
34 @listenTo(@filer, 'pick', @pick)
\r
39 has_one_model: () ->
\r
40 @has_one_manifest.model()
\r
43 @association.profiler
\r
45 add_pick: (target_model) ->
\r
46 @list.open((page_status) =>
\r
49 @filer.add_pick(target_model)
\r
53 @trigger('http_get', url)
\r
56 @trigger('pick', item)
\r