From b9455bfad9c3db43ef50624cc1c3f93e7d0bc2df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maximilian=20Kr=C3=B6g?= Date: Sun, 9 Feb 2020 17:56:40 +0100 Subject: [PATCH] Remove unnecessary / duplicate code. --- .../jsdoc/api/template/static/scripts/main.js | 19 +++---------------- 1 file changed, 3 insertions(+), 16 deletions(-) diff --git a/config/jsdoc/api/template/static/scripts/main.js b/config/jsdoc/api/template/static/scripts/main.js index 22943132ab..d6c755b948 100644 --- a/config/jsdoc/api/template/static/scripts/main.js +++ b/config/jsdoc/api/template/static/scripts/main.js @@ -3,16 +3,6 @@ $(function () { // Allow user configuration? const allowRegex = true; - // Search Items - $('#include_modules').change(function (e) { - console.log('change'); - if ($(this).is(':checked')) { - - } else { - - } - }); - const reNotCache = {}; function escapeRegexp(s, not) { if (not) { @@ -39,8 +29,7 @@ $(function () { var getSearchWeight = function (searchTerm, $matchedItem) { let weight = 0; // We could get smarter on the weight here - if ($matchedItem.data('shortname') - && $matchedItem.data('shortname').toLowerCase() === searchTerm.toLowerCase()) { + if ($matchedItem.data('shortname').toLowerCase() === searchTerm.toLowerCase()) { weight++; } return weight; @@ -82,19 +71,17 @@ $(function () { const $item = $(v); const name = $item.data('name'); - if (name && regexp.test(name)) { + if (regexp.test(name)) { const $classEntry = $item.closest('.item'); const $members = $item.closest('.member-list'); // Do the weight thing - $classEntry.removeData('weight'); - $classEntry.show(); const weight = getSearchWeight(searchTerm, $classEntry); $classEntry.data('weight', weight); + $item.show(); $members.show(); $classEntry.show(); - $item.show(); } });