+sub action_ajax_list {
+ my ($self) = @_;
+
+ my $js = SL::ClientJS->new;
+
+ if (!$::form->{clicked_id}) {
+ # Clicked on "sections" in the tree. Do nothing.
+ return $self->render($js);
+ }
+
+ $self->init_visible_section($::form->{current_content_id}, $::form->{current_content_type});
+ $self->item(SL::DB::RequirementSpecItem->new(id => $::form->{clicked_id})->load->get_section);
+
+ if (!$self->visible_section || ($self->visible_section->id != $self->item->id)) {
+ my $html = $self->render('requirement_spec_item/_section', { output => 0 }, requirement_spec_item => $self->item);
+ $js->html('#column-content', $html)
+ ->val('#current_content_type', $self->item->get_type)
+ ->val('#current_content_id', $self->item->id);
+ }
+
+ $self->render($js);
+}
+