summaryrefslogtreecommitdiffstatshomepage
path: root/core/modules/system/js/system.modules.js
diff options
context:
space:
mode:
authorLauri Eskola <lauri.eskola@acquia.com>2022-01-28 11:53:59 +0200
committerLauri Eskola <lauri.eskola@acquia.com>2022-01-28 11:53:59 +0200
commit8c62a32c2da35b38d60a7930863a65ae820b41b4 (patch)
tree7b1ccfc0bf843e8d1ddbc7b49a0d4dcdfe51dc09 /core/modules/system/js/system.modules.js
parent6b8783b23aece75da1cbc6eb59f1d2c6adfad2a1 (diff)
downloaddrupal-8c62a32c2da35b38d60a7930863a65ae820b41b4.tar.gz
drupal-8c62a32c2da35b38d60a7930863a65ae820b41b4.zip
Issue #3239123 by hooroomoo, bnjmnm, nod_: Refactor (if feasible) uses of the jQuery text function to use vanillaJS
Diffstat (limited to 'core/modules/system/js/system.modules.js')
-rw-r--r--core/modules/system/js/system.modules.js11
1 files changed, 7 insertions, 4 deletions
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();