From 8f6cde67492deccdc75477cc0f0f2ad25b875f53 Mon Sep 17 00:00:00 2001 From: Chris Jaekl Date: Wed, 29 Dec 2021 21:18:12 -0500 Subject: [PATCH] Fix slider max to match maximum attainable value. --- js/src/SearchController.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/js/src/SearchController.js b/js/src/SearchController.js index a4f4e4a..a02d27b 100644 --- a/js/src/SearchController.js +++ b/js/src/SearchController.js @@ -28,11 +28,13 @@ var SearchController = (function () { booksModel.ids = jsonValue; booksModel.count = booksModel.ids.length; booksModel.first = (-1); + + const max_pos = Math.max(0, booksModel.count - booksModel.pageSize); var elem = Browser.getElementById('slider'); - elem.max = booksModel.count; + elem.max = max_pos; elem = Browser.getElementById('bottom_slider'); - elem.max = booksModel.count; + elem.max = max_pos; PagingController.adjustPos(0); }) -- 2.39.2