]> wagnertech.de Git - mfinanz.git/blobdiff - SL/Controller/RequirementSpecItem.pm
jQuery.hotkeys-Plugin hinzugefügt
[mfinanz.git] / SL / Controller / RequirementSpecItem.pm
index ce24e3138b80a08113cf3bebb8e873a7ae72b9ae..7b1ed8194d6005911c1d515ecc38768e0dcca4a1 100644 (file)
@@ -84,11 +84,11 @@ sub action_dragged_and_dropped {
   my $old_visible_section = $self->visible_section ? $self->visible_section : undef;
   my $old_parent_id       = $self->item->parent_id;
   my $old_type            = $self->item->item_type;
   my $old_visible_section = $self->visible_section ? $self->visible_section : undef;
   my $old_parent_id       = $self->item->parent_id;
   my $old_type            = $self->item->item_type;
-  my $new_type            = $position =~ m/before|after/ ? $dropped_item->item_type : $dropped_item->child_type;
+  my $new_type            = !$dropped_item ? 'section' : $position =~ m/before|after/ ? $dropped_item->item_type : $dropped_item->child_type;
 
   $self->item->db->do_transaction(sub {
     $self->item->remove_from_list;
 
   $self->item->db->do_transaction(sub {
     $self->item->remove_from_list;
-    $self->item->parent_id($position =~ m/before|after/ ? $dropped_item->parent_id : $dropped_item->id);
+    $self->item->parent_id($position =~ m/before|after/ ? $dropped_item->parent_id : $dropped_item->id) if $dropped_item;
     $self->item->item_type($new_type);
     $self->item->add_to_list(position => $position, reference => $::form->{dropped_id} || undef);
   });
     $self->item->item_type($new_type);
     $self->item->add_to_list(position => $position, reference => $::form->{dropped_id} || undef);
   });
@@ -258,6 +258,7 @@ sub action_ajax_edit {
     ->hide($content_top_id)
     ->remove("#${id_base}_form")
     ->insertAfter($html, $content_top_id)
     ->hide($content_top_id)
     ->remove("#${id_base}_form")
     ->insertAfter($html, $content_top_id)
+    ->on("#${id_base}_form INPUT[type=text]", "keydown", "kivi.requirement_spec.text_block_input_key_down")
     ->jstree->select_node('#tree', '#fb-' . $self->item->id)
     ->focus("#${id_base}_description")
     ->val('#current_content_type', $self->item->item_type)
     ->jstree->select_node('#tree', '#fb-' . $self->item->id)
     ->focus("#${id_base}_description")
     ->val('#current_content_type', $self->item->item_type)