Skip to content

Commit

Permalink
link charts
Browse files Browse the repository at this point in the history
  • Loading branch information
Tsche committed Feb 21, 2024
1 parent 813a541 commit 9b6a8dc
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions doxygen-awesome/doxygen-awesome-tables.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ class DoxygenAwesomeTables {
* @param {function} detail_fnc
*/
static detailHandler(table, detail_fnc) {
waitForElement(`#${table} tbody`).then((_) => {
$(`#${table} tbody`).on('click', 'td.dt-control', function() {
waitForElement(`#${table} tbody`).then((element) => {
$(element).on('click', 'td.dt-control', function() {
const tr = $(this).closest('tr');
const row = $(`#${table}`).DataTable().row(tr);

Expand All @@ -48,7 +48,19 @@ class DoxygenAwesomeTables {
}

static jumpTo(table, search_fnc) {
$(`#${table}`).DataTable().row(search_fnc).select().show().draw(false);
const datatable = $(`#${table}`).DataTable();
datatable.rows().deselect();
datatable.row(search_fnc).select().show().draw(false);
}

static linkChart(chart, table, key) {
waitForElement(`#${chart}`).then((element) => {
element.addEventListener('data-select', (event) => {
DoxygenAwesomeTables.jumpTo(`#${table}`, (idx, data, node) => {
return data[key] == event.label;
});
});
});
}

static init() {
Expand Down

0 comments on commit 9b6a8dc

Please sign in to comment.