Skip to content

Commit

Permalink
Merge pull request #249 from vsimakhin/fix/remarks-content
Browse files Browse the repository at this point in the history
No longer shorten the remarks field for small screens
  • Loading branch information
vsimakhin authored Aug 30, 2024
2 parents 5453fcc + 042fa31 commit 3fecdc3
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 8 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

## [Unreleased]

- Update: No longer shorten the remarks field for small screens if the option "Do not adjust logbook columns for small screens" is selected
- Fix: Recreate the database view during startup in case changes didn't propagate after a version change.

## [2.41.0] - 11.08.2024
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ You also can easily export all flight records into EASA style pdf format, print

## [Unreleased]

- Update: No longer shorten the remarks field for small screens if the option "Do not adjust logbook columns for small screens" is selected
- Fix: Recreate the database view during startup in case changes didn't propagate after a version change.

## [2.41.0] - 11.08.2024
Expand Down
19 changes: 11 additions & 8 deletions app/static/js/wlb-logbook.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,19 @@ const logbookUtils = function () {
{ targets: [12], width: "9%" }, //pic
{
targets: [23], render: function (data, type, row) {
if (data.length !== 0 && data.length > remarksL) {
let txt = "";
if (remarksL < 0) { txt = data.substr(0, 5) + '…'; }
else { txt = data.substr(0, remarksL) + '…'; }
return `<span data-bs-toggle="tooltip" data-bs-placement="bottom" title="${commonUtils.escapeHtml(data)}">${commonUtils.escapeHtml(txt)}</span>`;
} else {
const cardWidth = document.getElementById('logbook_card').clientWidth;
if (cardWidth < 1500 && logbook_no_columns_change) {
return data;
}

if (data.length !== 0 && data.length > remarksL) {
const txt = remarksL < 0 ? data.substr(0, 5) + '…' : data.substr(0, remarksL) + '…';
const escapedData = commonUtils.escapeHtml(data);
const escapedTxt = commonUtils.escapeHtml(txt);
return `<span data-bs-toggle="tooltip" data-bs-placement="bottom" title="${escapedData}">${escapedTxt}</span>`;
}

return data;
}
}
],
Expand Down Expand Up @@ -168,9 +173,7 @@ const logbookUtils = function () {
}
const cardWidth = document.getElementById('logbook_card').clientWidth;

console.log(table.columns().count())
if (cardWidth >= 1500) {
console.log(table.columns())
table.columns([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23]).visible(true);
} else if (cardWidth >= 1000 && cardWidth < 1500) {
table.columns([1, 2, 3, 4, 5, 6, 7, 11, 12, 15, 16, 17, 18, 19, 20, 21, 22]).visible(true);
Expand Down

0 comments on commit 3fecdc3

Please sign in to comment.