|
1 | 1 | function gene_card_link_formatter(value, row) {
|
2 |
| - $(function () { |
3 |
| - $('[data-toggle="tooltip"]').tooltip() |
4 |
| - }); |
5 |
| - let genes = value.split(","); |
6 |
| - let rows = ""; |
7 |
| - for (let g of genes) { |
8 |
| - rows = `${rows}<tr><td><a data-toggle="tooltip" title="Linkout to genecards" href="https://www.genecards.org/cgi-bin/carddisp.pl?gene=${g}" target="_blank" rel="noopener noreferrer">${g}</a></td></tr>`; |
9 |
| - }; |
10 |
| - let table = `<div style="overflow-y: auto; max-height: 30vh; min-width: 140px;"><table class="table"><thead><tr><th scope="col">Genes</th></tr></thead><tbody>${rows}</tbody></table></div>`; |
11 |
| - let button = `<a href='#' tabindex='0' class='btn btn-primary' role='button' data-toggle='popover' data-placement="left" data-trigger='focus' data-html='true' data-content='${table}'><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-table" viewBox="0 0 16 16"> |
12 |
| - <path d="M0 2a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V2zm15 2h-4v3h4V4zm0 4h-4v3h4V8zm0 4h-4v3h3a1 1 0 0 0 1-1v-2zm-5 3v-3H6v3h4zm-5 0v-3H1v2a1 1 0 0 0 1 1h3zm-4-4h4V8H1v3zm0-4h4V4H1v3zm5-3v3h4V4H6zm4 4H6v3h4V8z"/> |
13 |
| - </svg></a>`; |
14 |
| - return button; |
| 2 | + let genes = value.split(","); |
| 3 | + let rows = ""; |
| 4 | + for (let g of genes) { |
| 5 | + rows += `<tr style="background-color: #f9f9f9; text-align: left;"> |
| 6 | + <td style="padding: 8px; border: 1px solid #dee2e6;"> |
| 7 | + <a style="color: #007bff;" title="Linkout to genecards" href="https://www.genecards.org/cgi-bin/carddisp.pl?gene=${g}" target="_blank" rel="noopener noreferrer">${g}</a> |
| 8 | + </td> |
| 9 | + </tr>`; |
| 10 | + } |
| 11 | + |
| 12 | + let table = `<div style="overflow-y: auto; max-height: 30vh; min-width: 140px;"> |
| 13 | + <table style="border-collapse: collapse; width: 100%; box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);"> |
| 14 | + <thead> |
| 15 | + <tr style="background-color: #007bff; color: white;"> |
| 16 | + <th scope="col" style="padding: 4px; text-align: left; height: 39px !important;">Genes</th> |
| 17 | + </tr> |
| 18 | + </thead> |
| 19 | + <tbody> |
| 20 | + ${rows} |
| 21 | + </tbody> |
| 22 | + </table> |
| 23 | + </div>`; |
| 24 | + |
| 25 | + let button = `<a href='#' tabindex='0' class='btn btn-primary' role='button' data-toggle='popover' data-placement="left" data-trigger='focus' data-html='true' data-content='${table}'> |
| 26 | + <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-table" viewBox="0 0 16 16"> |
| 27 | + <path d="M0 2a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V2zm15 2h-4v3h4V4zm0 4h-4v3h4V8zm0 4h-4v3h3a1 1 0 0 0 1-1v-2zm-5 3v-3H6v3h4zm-5 0v-3H1v2a1 1 0 0 0 1 1h3zm-4-4h4V8H1v3zm0-4h4V4H1v3zm5-3v3h4V4H6zm4 4H6v3h4V8z"/> |
| 28 | + </svg></a>`; |
| 29 | + |
| 30 | + return button; |
15 | 31 | }
|
0 commit comments