s/pl/ok/ #typo
[catagits/Reaction.git] / lib / Reaction / UI / ViewPort / Action / Role / OK.pm
CommitLineData
114916fc 1package Reaction::UI::ViewPort::Action::Role::OK;
2
3use Reaction::Role;
4use MooseX::Types::Moose qw/Str/;
5with 'Reaction::UI::ViewPort::Action::Role::Close';
6
7has ok_label => (is => 'rw', isa => 'Str', lazy_build => 1);
8
9sub _build_ok_label { 'ok' }
10
11sub ok {
12 my $self = shift;
13 $self->close(@_) if $self->apply(@_);
14}
15
16around accept_events => sub {
17 my $orig = shift;
18 my $self = shift;
1d6ef3dc 19 ( ($self->has_on_close_callback ? ('ok') : ()), $self->$orig(@_) );
114916fc 20};
21
221;