X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FReaction%2FUI%2FViewPort%2FCollection%2FGrid.pm;h=abdecc4e0c0cd3af983066b8d3cdf053119966da;hb=3c18c3227e21136f3e7d6feb51ef7745e0a6d412;hp=95fe43a7e7b083bb89c649158b524bf797bc93d0;hpb=eaa019f496871054fa18a0cd4a24d4a50378cc4a;p=catagits%2FReaction.git diff --git a/lib/Reaction/UI/ViewPort/Collection/Grid.pm b/lib/Reaction/UI/ViewPort/Collection/Grid.pm index 95fe43a..abdecc4 100644 --- a/lib/Reaction/UI/ViewPort/Collection/Grid.pm +++ b/lib/Reaction/UI/ViewPort/Collection/Grid.pm @@ -6,30 +6,31 @@ use aliased 'Reaction::InterfaceModel::Collection' => 'IM_Collection'; use aliased 'Reaction::UI::ViewPort::Collection::Grid::Member::WithActions'; use namespace::clean -except => [ qw(meta) ]; +use MooseX::Types::Moose qw/ArrayRef HashRef Int/; extends 'Reaction::UI::ViewPort::Collection'; -has field_order => ( is => 'ro', isa => 'ArrayRef', lazy_build => 1); -has excluded_fields => ( is => 'ro', isa => 'ArrayRef', lazy_build => 1); -has included_fields => ( is => 'ro', isa => 'ArrayRef', lazy_build => 1); -has computed_field_order => (is => 'ro', isa => 'ArrayRef', lazy_build => 1); +has field_order => ( is => 'ro', isa => ArrayRef, lazy_build => 1); +has excluded_fields => ( is => 'ro', isa => ArrayRef, lazy_build => 1); +has included_fields => ( is => 'ro', isa => ArrayRef, lazy_build => 1); +has computed_field_order => (is => 'ro', isa => ArrayRef, lazy_build => 1); has _raw_field_labels => ( is => 'rw', - isa => 'HashRef', + isa => HashRef, init_arg => 'field_labels', default => sub { {} }, ); has field_labels => ( is => 'ro', - isa => 'HashRef', + isa => HashRef, lazy_build => 1, init_arg => undef, ); has member_action_count => ( is => 'rw', - isa => 'Int', + isa => Int, required => 1, lazy => 1, default => sub { @@ -87,17 +88,8 @@ around _build_members => sub { my $orig = shift; my $self = shift; $self->member_args->{computed_field_order} ||= $self->computed_field_order; - $self->member_args->{computed_action_order} ||= []; my $members = $self->$orig(@_); - # cache everything yo - for my $member (@$members){ - $member->clear_computed_action_order; - my $order = $member->computed_action_order; - @{ $self->member_args->{computed_action_order} } = @$order; - last; - } - return $members; };