Show/hide pagination logic