From 32d37465fb3efc67182dce51a056ec146bbd0a22 Mon Sep 17 00:00:00 2001 From: barisusakli Date: Wed, 8 Mar 2017 20:09:35 +0300 Subject: [PATCH] limit size of select --- src/controllers/search.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/controllers/search.js b/src/controllers/search.js index 4ca7937687..bf818a39d5 100644 --- a/src/controllers/search.js +++ b/src/controllers/search.js @@ -60,7 +60,7 @@ searchController.search = function (req, res, next) { var searchData = results.search; searchData.categories = categoriesData; - searchData.categoriesCount = categoriesData.length; + searchData.categoriesCount = Math.max(10, Math.min(20, categoriesData.length)); searchData.pagination = pagination.create(page, searchData.pageCount, req.query); searchData.showAsPosts = !req.query.showAs || req.query.showAs === 'posts'; searchData.showAsTopics = req.query.showAs === 'topics';