From 609fe21402391f77079577a5e498b0973bdc82e8 Mon Sep 17 00:00:00 2001 From: Jessica Lawshe Date: Mon, 9 Dec 2019 09:09:09 -0600 Subject: [PATCH] Merge pull request #2438 from overleaf/jel-gallery-pagination Gallery pagination GitOrigin-RevId: 0592f60bcc094360bd3d5eddd9251630a4a892b6 --- services/web/app/views/_mixins/pagination.pug | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/services/web/app/views/_mixins/pagination.pug b/services/web/app/views/_mixins/pagination.pug index 4ac2d924e8..717cf0d5e2 100644 --- a/services/web/app/views/_mixins/pagination.pug +++ b/services/web/app/views/_mixins/pagination.pug @@ -1,4 +1,4 @@ -mixin paginate(pages, page_path, max_btns) +mixin pagination(pages, page_path, max_btns) //- @param pages.current_page the current page viewed //- @param pages.total_pages previously calculated, //- based on total entries and entries per page @@ -6,7 +6,7 @@ mixin paginate(pages, page_path, max_btns) //- @param max_btns max number of buttons on either side of the current page //- button and excludes first, prev, next, last - if pages && pages.current_page && pages.total_pages + if pages && pages.current_page && pages.total_pages && pages.total_pages > 1 - var max_btns = max_btns || 4 - var prev_page = Math.max(parseInt(pages.current_page, 10) - max_btns, 1) - var next_page = parseInt(pages.current_page, 10) + 1