]> jaekl.net Git - quanweb.git/commitdiff
Fix slider max to match maximum attainable value.
authorChris Jaekl <chris@localhost>
Thu, 30 Dec 2021 02:18:12 +0000 (21:18 -0500)
committerChris Jaekl <chris@localhost>
Thu, 30 Dec 2021 02:18:12 +0000 (21:18 -0500)
js/src/SearchController.js

index a4f4e4a72ace1bb3ade06e88610cb78dc8111d39..a02d27bae05f905187ce3306fb9c928e627c72fe 100644 (file)
@@ -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);
             })