Pflichtenheftitem: nach Update evtl. auch Parent-Bottom neu rendern
authorMoritz Bunkus <m.bunkus@linet-services.de>
Mon, 11 Mar 2013 11:53:25 +0000 (12:53 +0100)
committerMoritz Bunkus <m.bunkus@linet-services.de>
Tue, 1 Apr 2014 11:02:26 +0000 (13:02 +0200)
SL/Controller/RequirementSpecItem.pm

index 75dc503..c197aad 100644 (file)
@@ -131,12 +131,19 @@ sub action_ajax_update {
   my $html_bottom  = $self->render('requirement_spec_item/_function_block_content_bottom', { output => 0 }, requirement_spec_item => $self->item, id_prefix => $id_prefix);
   $id_prefix      .= 'function-block-content-';
 
-  SL::ClientJS->new
+  my $js = SL::ClientJS->new
     ->remove('#' . $prefix . '_form')
     ->replaceWith('#' . $id_prefix . 'top-'    . $self->item->id, $html_top)
     ->replaceWith('#' . $id_prefix . 'bottom-' . $self->item->id, $html_bottom)
-    ->jstree->rename_node('#tree', '#fb-' . $self->item->id, $::request->presenter->requirement_spec_item_tree_node_title($self->item))
-    ->render($self);
+    ->jstree->rename_node('#tree', '#fb-' . $self->item->id, $::request->presenter->requirement_spec_item_tree_node_title($self->item));
+
+
+  if ($self->item->get_type eq 'sub-function-block') {
+    my $parent_html_bottom = $self->render('requirement_spec_item/_function_block_content_bottom', { output => 0 }, requirement_spec_item => $self->item->parent->load);
+    $js->replaceWith('#function-block-content-bottom-' . $self->item->parent->id, $parent_html_bottom);
+  }
+
+  $js->render($self);
 }
 
 #