Pflichtenhefte: in Zeitabschätzungsmaske erste Selectbox focussen
authorMoritz Bunkus <m.bunkus@linet-services.de>
Mon, 2 Sep 2013 09:26:23 +0000 (11:26 +0200)
committerMoritz Bunkus <m.bunkus@linet-services.de>
Tue, 1 Apr 2014 11:10:32 +0000 (13:10 +0200)
SL/Controller/RequirementSpec.pm
templates/webpages/requirement_spec/_edit_time_and_cost_estimate_item.html

index f99e0bf..ee0a94f 100644 (file)
@@ -120,11 +120,14 @@ sub action_ajax_edit_time_and_cost_estimate {
   my ($self) = @_;
 
   my $html   = $self->render('requirement_spec/_edit_time_and_cost_estimate', { output => 0 });
+  my $first  = ($self->requirement_spec->sections_sorted || [])->[0];
+  $first     = ($first->children_sorted || [])->[0] if $first;
 
   $self->js
    ->hide('#time_cost_estimate')
    ->after('#time_cost_estimate', $html)
    ->on('#time_cost_estimate INPUT[type=text]', 'keydown', 'kivi.requirement_spec.time_cost_estimate_input_key_down')
+   ->action_if($first && $first->id, 'focus', '#time_and_cost_estimate_form_complexity_id_' . $first->id)
    ->render($self);
 }
 
index e3975a9..593de9a 100644 (file)
@@ -6,10 +6,10 @@
   [%- P.simple_format(item.fb_number _ ": " _ item.description) -%]
  </td>
  <td>
-  [%- L.select_tag('requirement_spec_items[].complexity_id', SELF.complexities, id=id_prefix _ '_complexity_id', title_key='description', default=item.complexity_id, style="width: 100%") %]<br>
+  [%- L.select_tag('requirement_spec_items[].complexity_id', SELF.complexities, id=id_prefix _ '_complexity_id_' _ item.id, title_key='description', default=item.complexity_id, style="width: 100%") %]<br>
  </td>
  <td>
-  [%- L.select_tag('requirement_spec_items[].risk_id', SELF.risks, id=id_prefix _ '_risk_id', title_key='description', default=item.risk_id, style="width: 100%") %]<br>
+  [%- L.select_tag('requirement_spec_items[].risk_id', SELF.risks, id=id_prefix _ '_risk_id_' _ item.id, title_key='description', default=item.risk_id, style="width: 100%") %]<br>
  </td>
  [%- IF !item.children.size -%]
   <td align="right" nowrap>[%- P.man_days_tag('requirement_spec_items[].time_estimation', item, id=id_prefix _ '_time_estimation') %]</td>