Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 6bcd3c84

Von Moritz Bunkus vor mehr als 10 Jahren hinzugefügt

  • ID 6bcd3c849d50f9df3b40031e2899b7e14c34875a
  • Vorgänger 3ab10ea9
  • Nachfolger e2e7e282

Pflichtenhefte: Drag & Drop von Abschnitten fixen

Unterschiede anzeigen:

SL/Controller/RequirementSpecItem.pm
84 84
  my $old_visible_section = $self->visible_section ? $self->visible_section : undef;
85 85
  my $old_parent_id       = $self->item->parent_id;
86 86
  my $old_type            = $self->item->item_type;
87
  my $new_type            = $position =~ m/before|after/ ? $dropped_item->item_type : $dropped_item->child_type;
87
  my $new_type            = !$dropped_item ? 'section' : $position =~ m/before|after/ ? $dropped_item->item_type : $dropped_item->child_type;
88 88

  
89 89
  $self->item->db->do_transaction(sub {
90 90
    $self->item->remove_from_list;
91
    $self->item->parent_id($position =~ m/before|after/ ? $dropped_item->parent_id : $dropped_item->id);
91
    $self->item->parent_id($position =~ m/before|after/ ? $dropped_item->parent_id : $dropped_item->id) if $dropped_item;
92 92
    $self->item->item_type($new_type);
93 93
    $self->item->add_to_list(position => $position, reference => $::form->{dropped_id} || undef);
94 94
  });

Auch abrufbar als: Unified diff