Commit | Line | Data |
---|---|---|
2f670e13 | 1 | package Reaction::UI::Widget::Action; |
9de685fc | 2 | |
3 | use Reaction::UI::WidgetClass; | |
4 | ||
bae75bee | 5 | use namespace::clean -except => [ qw(meta) ]; |
6 | extends 'Reaction::UI::Widget::Object'; | |
9de685fc | 7 | |
bae75bee | 8 | |
9 | ||
10 | after fragment widget { | |
11 | arg 'method' => $_{viewport}->method; | |
12 | }; | |
13 | ||
14 | implements fragment ok_button_fragment { | |
15 | if (grep { $_ eq 'ok' } $_{viewport}->accept_events) { | |
16 | arg 'event_id' => event_id 'ok'; | |
17 | arg 'label' => $_{viewport}->ok_label; | |
18 | render 'ok_button'; | |
19 | } | |
20 | }; | |
21 | ||
22 | implements fragment apply_button_fragment { | |
23 | if (grep { $_ eq 'apply' } $_{viewport}->accept_events) { | |
24 | arg 'event_id' => event_id 'apply'; | |
25 | arg 'label' => $_{viewport}->apply_label; | |
26 | render 'apply_button'; | |
27 | } | |
28 | }; | |
29 | ||
30 | implements fragment cancel_button_fragment { | |
31 | if (grep { $_ eq 'close' } $_{viewport}->accept_events) { | |
32 | arg 'event_id' => event_id 'close'; | |
33 | arg 'label' => $_{viewport}->close_label; | |
34 | render 'cancel_button'; | |
35 | } | |
9de685fc | 36 | }; |
37 | ||
bae75bee | 38 | __PACKAGE__->meta->make_immutable; |
39 | ||
40 | ||
9de685fc | 41 | 1; |
42 | ||
43 | __END__; | |
44 | ||
5a1a893e | 45 | =head1 NAME |
9de685fc | 46 | |
2f670e13 | 47 | Reaction::UI::Widget::Action |
9de685fc | 48 | |
5a1a893e | 49 | =head1 DESCRIPTION |
9de685fc | 50 | |
5a1a893e | 51 | =head1 FRAGMENTS |
9de685fc | 52 | |
cc44a337 | 53 | =head2 ok_button_fragment |
5a1a893e | 54 | |
cc44a337 | 55 | =head2 apply_button_fragment |
5a1a893e | 56 | |
cc44a337 | 57 | =head2 cancel_button_fragment |
5a1a893e | 58 | |
59 | =head1 AUTHORS | |
60 | ||
61 | See L<Reaction::Class> for authors. | |
62 | ||
63 | =head1 LICENSE | |
64 | ||
65 | See L<Reaction::Class> for the license. | |
9de685fc | 66 | |
67 | =cut | |
5a1a893e | 68 |