Skip to content
This repository has been archived by the owner on May 8, 2022. It is now read-only.

Commit

Permalink
Allow mapping table to be sorted by timeshift. Closes #5
Browse files Browse the repository at this point in the history
  • Loading branch information
SCP002 committed Mar 28, 2022
1 parent 7d9afad commit 84f3184
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 24 deletions.
2 changes: 1 addition & 1 deletion html/js/base_ts.js
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ function sortTable(column) {
sortObj[i] = rows[i];
}
else {
switch (isNaN(xValue)) {
switch (isNaN(xValue) || typeof xValue == "string") {
case false:
xValue = parseFloat(xValue);
sortObj[xValue] = rows[i];
Expand Down
4 changes: 4 additions & 0 deletions html/js/menu_ts.js
Original file line number Diff line number Diff line change
Expand Up @@ -625,6 +625,10 @@ class ShowContent extends Content {
cell.onclick = true;
cell.onclickFunktion = "javascript: sortTable(5);";
}
if (element == "{{.mapping.table.timeshift}}") {
cell.onclick = true;
cell.onclickFunktion = "javascript: sortTable(8);";
}
}
header.appendChild(cell.createCell());
});
Expand Down
44 changes: 22 additions & 22 deletions src/webUI.go

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion ts/base_ts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ function sortTable(column) {

} else {

switch(isNaN(xValue)) {
switch(isNaN(xValue) || typeof xValue == "string") {
case false:

xValue = parseFloat(xValue);
Expand Down
5 changes: 5 additions & 0 deletions ts/menu_ts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -796,6 +796,11 @@ class ShowContent extends Content {
cell.onclickFunktion = "javascript: sortTable(5);"
}

if (element == "{{.mapping.table.timeshift}}") {
cell.onclick = true
cell.onclickFunktion = "javascript: sortTable(8);"
}

}

header.appendChild(cell.createCell())
Expand Down

0 comments on commit 84f3184

Please sign in to comment.