Skip to content

Commit

Permalink
Fixed the search in the admin sidebar to also search in the 'search' …
Browse files Browse the repository at this point in the history
…attribute as before.
  • Loading branch information
filiptypjeu committed Aug 24, 2023
1 parent 427386f commit 263b659
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion teknologr/members/static/js/base.js
Original file line number Diff line number Diff line change
Expand Up @@ -183,8 +183,11 @@ $(document).ready(function () {
const element = $(this);
let show = true;
// All parts of the query need to match the content
const text_content = element.text().toLowerCase();
const search_attribute = element.attr("search").toLowerCase();
for (const q of queries) {
if (!element.text().toLowerCase().includes(q)) {
// Check both text and 'search' attribute
if (!text_content.includes(q) && !search_attribute.includes(q)) {
show = false;
break;
}
Expand Down

0 comments on commit 263b659

Please sign in to comment.