From: Chris Jaekl Date: Thu, 30 Dec 2021 02:18:12 +0000 (-0500) Subject: Fix slider max to match maximum attainable value. X-Git-Url: https://jaekl.net/gitweb/?a=commitdiff_plain;h=8f6cde67492deccdc75477cc0f0f2ad25b875f53;p=quanweb.git Fix slider max to match maximum attainable value. --- 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); })