Revision 90f4ba5d
Von Moritz Bunkus vor mehr als 10 Jahren hinzugefügt
SL/Controller/RequirementSpecItem.pm | ||
---|---|---|
23 | 23 |
'scalar --get_set_init' => [ qw(complexities risks) ], |
24 | 24 |
); |
25 | 25 |
|
26 |
__PACKAGE__->run_before('load_requirement_spec_item', only => [ qw(dragged_and_dropped ajax_update ajax_edit ajax_delete) ]); |
|
26 |
__PACKAGE__->run_before('load_requirement_spec_item', only => [ qw(dragged_and_dropped ajax_update ajax_edit ajax_delete ajax_flag) ]);
|
|
27 | 27 |
__PACKAGE__->run_before('init_visible_section'); |
28 | 28 |
|
29 | 29 |
# |
... | ... | |
322 | 322 |
->render($self); |
323 | 323 |
} |
324 | 324 |
|
325 |
sub action_ajax_flag { |
|
326 |
my ($self) = @_; |
|
327 |
|
|
328 |
$self->item->update_attributes(is_flagged => !$self->item->is_flagged); |
|
329 |
|
|
330 |
my $is_visible = $self->visible_section && ($self->visible_section->id == $self->item->get_section->id); |
|
331 |
|
|
332 |
SL::ClientJS->new |
|
333 |
->action_if($is_visible, 'toggleClass', '#' . $self->item->get_type . '-' . $self->item->id, 'flagged') |
|
334 |
->toggleClass('#fb-' . $self->item->id, 'flagged') |
|
335 |
->render($self); |
|
336 |
} |
|
337 |
|
|
325 | 338 |
# |
326 | 339 |
# filters |
327 | 340 |
# |
Auch abrufbar als: Unified diff
Pflichtenhefte: Textblöcke, Abschnitte und Funktionsblöcke markieren können