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