diff options
Diffstat (limited to 'lib/Reaction')
-rw-r--r-- | lib/Reaction/UI/Controller.pm | 4 | ||||
-rw-r--r-- | lib/Reaction/UI/Controller/Collection/CRUD.pm | 10 |
2 files changed, 10 insertions, 4 deletions
diff --git a/lib/Reaction/UI/Controller.pm b/lib/Reaction/UI/Controller.pm index 46456bd..8ed781f 100644 --- a/lib/Reaction/UI/Controller.pm +++ b/lib/Reaction/UI/Controller.pm @@ -26,9 +26,7 @@ sub push_viewport { $vp_attr = $vp_attr->[0]; } if (ref($vp_attr) eq 'HASH') { - if (my $conf_class = delete $vp_attr->{class}) { - $class = $conf_class; - } + $class = $vp_attr->{class} if defined $vp_attr->{class}; %args = %{ $self->merge_config_hashes($vp_attr, {@proto_args}) }; } else { $class = $vp_attr; diff --git a/lib/Reaction/UI/Controller/Collection/CRUD.pm b/lib/Reaction/UI/Controller/Collection/CRUD.pm index 6dfed13..11a29f9 100644 --- a/lib/Reaction/UI/Controller/Collection/CRUD.pm +++ b/lib/Reaction/UI/Controller/Collection/CRUD.pm @@ -90,13 +90,21 @@ sub on_update_close_callback { sub delete :Chained('object') :Args(0) { my ($self, $c) = @_; - my $close = sub { $self->on_update_close_callback( @_) }; + my $close = sub { $self->on_delete_close_callback( @_) }; my $vp_args = { on_close_callback => $self->make_context_closure($close), }; $self->basic_model_action( $c, $vp_args); } +sub on_delete_close_callback { + my($self, $c) = @_; + #this needs a better solution. currently thinking about it + my @cap = @{$c->req->captures}; + pop(@cap); # object id + $self->redirect_to($c, 'list', \@cap); +} + sub basic_model_action { my ($self, $c, $vp_args) = @_; my $stash = $c->stash; |