Skip to content

Commit b6da917

Browse files
authored
Merge pull request #5 from opencobra/constructor_dev
fix bugs in header display and search bar
2 parents 309dcde + ebaf192 commit b6da917

File tree

2 files changed

+15
-13
lines changed

2 files changed

+15
-13
lines changed

curationTool/reactions/static/reactions/js/status.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ function setLoggedInStatusBasedOnUrl(reactionData) {
2020
status = "Creating Reaction";
2121
dotClass = "dot-red";
2222
} else {
23-
status = `Editing reaction <br>
23+
status = `Editing reaction
2424
<span class="reaction-name" data-tooltip-this="${reactionDescription}">${reactionName}</span>`;
2525
dotClass = "dot-orange";
2626
}

curationTool/reactions/static/reactions/js_savedreactions/search_reaction.js

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,21 +4,23 @@ document.addEventListener('DOMContentLoaded', () => {
44

55
searchInput.addEventListener('input', () => {
66
const query = searchInput.value.toLowerCase();
7-
const rows = reactionListBody.getElementsByTagName('tr'); // Only get rows from tbody
7+
const rows = reactionListBody.getElementsByTagName('tr');
88

99
Array.from(rows).forEach(row => {
10-
// Check if the row is currently visible
11-
if (row.style.display !== 'none') {
12-
const name = row.cells[1].textContent.toLowerCase();
13-
const subsystem = row.cells[2].textContent.toLowerCase();
14-
const substrates = row.cells[3].textContent.toLowerCase();
15-
const products = row.cells[4].textContent.toLowerCase();
10+
const name = row.cells[1].textContent.toLowerCase();
11+
const subsystem = row.cells[2].textContent.toLowerCase();
12+
const substrates = row.cells[3].textContent.toLowerCase();
13+
const products = row.cells[4].textContent.toLowerCase();
1614

17-
if (name.includes(query) || subsystem.includes(query) || substrates.includes(query) || products.includes(query)) {
18-
row.style.display = ''; // Show row
19-
} else {
20-
row.style.display = 'none'; // Hide row
21-
}
15+
if (
16+
name.includes(query) ||
17+
subsystem.includes(query) ||
18+
substrates.includes(query) ||
19+
products.includes(query)
20+
) {
21+
row.style.display = ''; // Show row
22+
} else {
23+
row.style.display = 'none'; // Hide row
2224
}
2325
});
2426
});

0 commit comments

Comments
 (0)