diff options
Diffstat (limited to 'lib/Reaction/UI/ViewPort/Collection/Role/Pager.pm')
-rw-r--r-- | lib/Reaction/UI/ViewPort/Collection/Role/Pager.pm | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/Reaction/UI/ViewPort/Collection/Role/Pager.pm b/lib/Reaction/UI/ViewPort/Collection/Role/Pager.pm index 64752a6..5f7c8f2 100644 --- a/lib/Reaction/UI/ViewPort/Collection/Role/Pager.pm +++ b/lib/Reaction/UI/ViewPort/Collection/Role/Pager.pm @@ -11,7 +11,7 @@ use namespace::clean -except => [ qw(meta) ]; #has paged_collection => (isa => Collection, is => 'rw', lazy_build => 1); has pager => (isa => 'Data::Page', is => 'rw', lazy_build => 1); -has page => (isa => 'Int', is => 'rw', lazy_build => 1, trigger_adopt('page')); +has page => (isa => 'Int', is => 'rw', lazy_build => 1, trigger_adopt('page'), clearer => 'clear_page'); has per_page => (isa => 'Int', is => 'rw', lazy_build => 1, trigger_adopt('page')); has per_page_max => (isa => 'Int', is => 'rw', lazy_build => 1); sub _build_page { 1 }; @@ -26,6 +26,12 @@ sub adopt_page { $self->clear_current_collection; }; +after clear_page => sub { + my ($self) = @_; + $self->clear_pager; + $self->clear_current_collection; +}; + around accept_events => sub { ('page','per_page', shift->(@_)); }; #implements build_paged_collection => as { |