fix to call beforeMove when clicking on the pagination links
always call beforeMove and afterMove with the index of the page that
we're moving to, not the page that we're moving from
Merge branch 'fix_before_move_on_pagination'