From 8c62a32c2da35b38d60a7930863a65ae820b41b4 Mon Sep 17 00:00:00 2001 From: Lauri Eskola Date: Fri, 28 Jan 2022 11:53:59 +0200 Subject: Issue #3239123 by hooroomoo, bnjmnm, nod_: Refactor (if feasible) uses of the jQuery text function to use vanillaJS --- core/modules/system/js/system.modules.js | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'core/modules/system/js/system.modules.js') diff --git a/core/modules/system/js/system.modules.js b/core/modules/system/js/system.modules.js index 98f53c683bc8..fb19695e9fde 100644 --- a/core/modules/system/js/system.modules.js +++ b/core/modules/system/js/system.modules.js @@ -31,10 +31,13 @@ const re = new RegExp(`\\b${query}`, 'i'); function showModuleRow(index, row) { - const $row = $(row); - const $sources = $row.find('.table-filter-text-source, .module-name, .module-description'); - const textMatch = $sources.text().search(re) !== -1; - $row.closest('tr').toggle(textMatch); + const sources = row.querySelectorAll('.table-filter-text-source, .module-name, .module-description'); + let sourcesConcat = ''; + sources.forEach(item => { + sourcesConcat += item.textContent; + }); + const textMatch = sourcesConcat.search(re) !== -1; + $(row).closest('tr').toggle(textMatch); } $rowsAndDetails.show(); -- cgit v1.2.3