diff options
-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 { |