diff options
author | wreis <wreis@03d0b0b2-0e1a-0410-a411-fdb2f4bd65d7> | 2009-08-01 01:16:38 +0000 |
---|---|---|
committer | wreis <wreis@03d0b0b2-0e1a-0410-a411-fdb2f4bd65d7> | 2009-08-01 01:16:38 +0000 |
commit | 0caf173ef392e2b60ac2587a2d1c1f9cdfe919ed (patch) | |
tree | d6633c0cde2be5d25825760d55f1427823fa0255 | |
parent | 3c18c3227e21136f3e7d6feb51ef7745e0a6d412 (diff) | |
download | reaction-0caf173ef392e2b60ac2587a2d1c1f9cdfe919ed.tar.gz reaction-0caf173ef392e2b60ac2587a2d1c1f9cdfe919ed.zip |
fix for action_filter
-rw-r--r-- | lib/Reaction/UI/ViewPort/Role/Actions.pm | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/lib/Reaction/UI/ViewPort/Role/Actions.pm b/lib/Reaction/UI/ViewPort/Role/Actions.pm index ebd2d3c..32c7bbb 100644 --- a/lib/Reaction/UI/ViewPort/Role/Actions.pm +++ b/lib/Reaction/UI/ViewPort/Role/Actions.pm @@ -33,14 +33,21 @@ has computed_action_order => ( lazy_build => 1 ); +sub _filter_action_list { + my $self = shift; + my $actions = [keys %{$self->action_prototypes}]; + return $self->has_action_filter ? + $self->action_filter->($actions, $self->model) + : $actions; +} + sub _build_computed_action_order { my $self = shift; my $ordered = $self->sort_by_spec( ($self->has_action_order ? $self->action_order : []), - [ keys %{ $self->action_prototypes } ] + $self->_filter_action_list ); - return $self->has_action_filter ? - $self->action_filter->($ordered, $self->model) : $ordered; + return $ordered; } sub _build_actions { |