Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 7e771bdf

Von Moritz Bunkus vor mehr als 10 Jahren hinzugefügt

  • ID 7e771bdf6e12012d050819d91dbaa035df465797
  • Vorgänger 5187eea8
  • Nachfolger 91dc1ae9

Pflichtenheftitems: current_content_type/_id nach Auswahl eines bereits Angezeigten fixen

Unterschiede anzeigen:

SL/Controller/RequirementSpecItem.pm
40 40
    return $self->render($js);
41 41
  }
42 42

  
43
  $self->item(SL::DB::RequirementSpecItem->new(id => $::form->{clicked_id})->load->get_section);
43
  my $clicked_item = SL::DB::RequirementSpecItem->new(id => $::form->{clicked_id})->load;
44
  $self->item($clicked_item->get_section);
44 45

  
45
  $self->render_list($js, $self->item) if !$self->visible_section || ($self->visible_section->id != $self->item->id);
46
  if (!$self->visible_section || ($self->visible_section->id != $self->item->id)) {
47
    $self->render_list($js, $self->item, $clicked_item);
48
  } else {
49
    $self->select_node($js, $clicked_item);
50
  }
46 51

  
47 52
  $self->render($js);
48 53
}
......
398 403
}
399 404

  
400 405
sub render_list {
401
  my ($self, $js, $item) = @_;
406
  my ($self, $js, $item, $item_to_select) = @_;
402 407

  
403 408
  my $html = $self->render('requirement_spec_item/_section', { output => 0 }, requirement_spec_item => $item);
404
  $js->html('#column-content',      $html)
405
     ->val( '#current_content_type', $item->get_type)
409
  $self->select_node($js->html('#column-content', $html), $item_to_select || $item);
410
}
411

  
412
sub select_node {
413
  my ($self, $js, $item) = @_;
414

  
415
  $js->val( '#current_content_type', $item->get_type)
406 416
     ->val( '#current_content_id',   $item->id)
407 417
     ->jstree->select_node('#tree', '#fb-' . $item->id);
408 418
}

Auch abrufbar als: Unified diff