-class Locmare.Profiler extends Backbone.View\r
+class Locmare.Profiler extends Pettanr.View\r
tagName: 'div'\r
+ className: 'profiler'\r
+ \r
initialize: (options) ->\r
@item_name = options.item_name\r
@item = options.item\r
# feasible show parsed extend data\r
- @item.boosts 'post'\r
- @operators = options.operators\r
\r
@profiler_manifest = LocalManifest.manifest().profilers[@item_name]\r
- @template_dir = 'templates-profiler-'\r
@header = new Locmare.ProfilerModule.Header({profiler: this})\r
@columns = new Locmare.ProfilerModule.Column({profiler: this})\r
@associations = new Locmare.ProfilerModule.Association({'profiler': this, association_manifest: @profiler_manifest.associations})\r
- @render()\r
+ @listenTo(@header, 'http_get', @http_get)\r
+ @listenTo(@associations, 'http_get', @http_get)\r
+ @listenTo(@associations, 'pick', @click_pick)\r
\r
render: () ->\r
this.$el.html('')\r
this.$el.append(@header.render().el)\r
this.$el.append(@columns.render().el)\r
this.$el.append(@associations.render().el)\r
- $("#pettanr").html(this.el)\r
this\r
\r
peta: () ->\r
image_dir: () ->\r
'/images/'\r
\r
+ is_pickable: () ->\r
+ true\r
+ \r
+ add_pick: (target_model) ->\r
+ @header.add_pick(target_model)\r
+ @associations.add_pick(target_model)\r
+ \r
+ http_get: (url) ->\r
+ @trigger('http_get', url)\r
+ \r
+ click_pick: (item) ->\r
+ @trigger('pick', item)\r
+ \r
class Locmare.ProfilerModule\r
\r
- \r