diff options
author | edenc <edenc@03d0b0b2-0e1a-0410-a411-fdb2f4bd65d7> | 2008-08-08 00:57:13 +0000 |
---|---|---|
committer | edenc <edenc@03d0b0b2-0e1a-0410-a411-fdb2f4bd65d7> | 2008-08-08 00:57:13 +0000 |
commit | 52f292b24eca44347e5f1bfcffe4cedf5465766b (patch) | |
tree | da0437d1ee31f62f33aeb916845e2f15998192f8 /lib/Reaction/UI/ViewPort/Action.pm | |
parent | a86de581e80ee37e60860bde8ddaa975ff7dd6c9 (diff) | |
download | reaction-52f292b24eca44347e5f1bfcffe4cedf5465766b.tar.gz reaction-52f292b24eca44347e5f1bfcffe4cedf5465766b.zip |
removed viewport dependency on ->ctx
Diffstat (limited to 'lib/Reaction/UI/ViewPort/Action.pm')
-rw-r--r-- | lib/Reaction/UI/ViewPort/Action.pm | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/lib/Reaction/UI/ViewPort/Action.pm b/lib/Reaction/UI/ViewPort/Action.pm index b62e68f..8ec12e4 100644 --- a/lib/Reaction/UI/ViewPort/Action.pm +++ b/lib/Reaction/UI/ViewPort/Action.pm @@ -30,8 +30,8 @@ has model => (is => 'ro', isa => 'Reaction::InterfaceModel::Action', required = #has '+model' => (isa => 'Reaction::InterfaceModel::Action'); has method => ( isa => NonEmptySimpleStr, is => 'rw', default => sub { 'post' } ); -has next_action => (is => 'rw', isa => 'ArrayRef'); has on_apply_callback => (is => 'rw', isa => 'CodeRef'); +has on_close_callback => (is => 'rw', isa => 'CodeRef'); has ok_label => (is => 'rw', isa => 'Str', lazy_build => 1); has apply_label => (is => 'rw', isa => 'Str', lazy_build => 1); @@ -96,14 +96,13 @@ sub apply { }; sub close { my $self = shift; - my ($controller, $name, @args) = @{$self->next_action}; - $controller->pop_viewport; - $controller->$name($self->ctx, @args); + return unless $self->has_on_close_callback; + $self->on_close_callback->($self); }; sub can_close { 1 }; override accept_events => sub { - (($_[0]->has_next_action ? ('ok', 'close') : ()), 'apply', super()); + (($_[0]->has_on_close_callback ? ('ok', 'close') : ()), 'apply', super()); }; # can't do a close-type operation if there's nowhere to go afterwards after apply_child_events => sub { |