Pflichtenheftitems: Masken für neue (Unter)Funktionsblöcke
[kivitendo-erp.git] / SL / Controller / RequirementSpecTextBlock.pm
index e7964a6..7d339a8 100644 (file)
@@ -11,7 +11,6 @@ use SL::DB::RequirementSpec;
 use SL::DB::RequirementSpecPredefinedText;
 use SL::DB::RequirementSpecTextBlock;
 use SL::Helper::Flash;
-use SL::JSON;
 use SL::Locale::String;
 
 use Rose::Object::MakeMethods::Generic
@@ -49,6 +48,8 @@ sub action_ajax_list {
     my $html        = $self->render('requirement_spec_text_block/ajax_list', { output => 0 }, TEXT_BLOCKS => $text_blocks, output_position => $new_where);
 
     $js->html('#column-content', $html)
+       ->val('#current_content_type', 'text-blocks-' . (0 == $new_where ? 'front' : 'back'))
+       ->val('#current_content_id',   $::form->{clicked_id});
   }
 
   $self->render($js);
@@ -225,7 +226,7 @@ sub action_dragged_and_dropped {
       if ($prior_text_block) {
         $js->insertAfter($html, '#text-block-' . $prior_text_block->id);
       } else {
-        $js->appendTo($html, '#text-block-list');
+        $js->prependTo($html, '#text-block-list');
       }
     }
   }