Class: ODDB::View::Admin::RootCompositionList

Inherits:
CompositionList show all
Defined in:
src/view/admin/sequence.rb

Constant Summary

Constants inherited from CompositionList

COMPONENTS, LABELS, OFFSET_STEP, OMIT_HEADER

Instance Attribute Summary (collapse)

Instance Method Summary (collapse)

Instance Attribute Details

- (Object) list_index (readonly)

Returns the value of attribute list_index



190
191
192
# File 'src/view/admin/sequence.rb', line 190

def list_index
  @list_index
end

Instance Method Details

- (Object) add(model)



191
192
193
194
195
196
197
198
# File 'src/view/admin/sequence.rb', line 191

def add(model)
  link = HtmlGrid::Link.new(:create_composition, model, @session, self)
  link.css_class = 'ajax'
  args = [ :pointer, @session.state.model.pointer ]
  url = @session.lookandfeel.event_url(:ajax_create_composition, args)
  link.onclick = "replace_element('composition-list', '#{url}');"
  link
end

- (Object) compose



199
200
201
202
203
# File 'src/view/admin/sequence.rb', line 199

def compose
  super
  comp = @model.last
  @grid.push [add(@model)] if comp.nil? || !comp.active_agents.compact.empty?
end

- (Object) composition(model)



204
205
206
# File 'src/view/admin/sequence.rb', line 204

def composition(model)
  RootActiveAgents.new(model.active_agents, @session, self)
end