1 class Locmare.ProfilerModule.AssociationModule.HasOne extends Backbone.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 @profiler().operators,
\r
13 {id: @item().get('id')}
\r
18 @list.open((page_status) =>
\r
26 this.$el.html(@filer.el)
\r
30 @filer = new Locmare.Filer({
\r
31 item_name: @has_one_model().item_name(),
\r
32 items: @list.items(),
\r
34 operators: @profiler().operators
\r
37 @listenTo(@filer, 'http_get', @http_get)
\r
38 @listenTo(@filer, 'pick', @pick)
\r
43 has_one_model: () ->
\r
44 @has_one_manifest.model()
\r
47 @association.profiler
\r
49 add_pick: (target_model) ->
\r
50 @list.open((page_status) =>
\r
53 @filer.add_pick(target_model)
\r
57 @trigger('http_get', url)
\r
60 @trigger('pick', item)
\r