Skip to content

Commit

Permalink
Merge pull request #358 from AOEpeople/bugfix/#260360-tv-responsivness
Browse files Browse the repository at this point in the history
added a minimum height for the central component to fix overflowing
  • Loading branch information
hacksch authored Oct 11, 2023
2 parents 6fd4fd8 + dcf8762 commit 3359c1e
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions src/Resources/src/services/useComponentHeights.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ interface IComponentHeightState {
screenHeight: number
}

const MIN_TABLE_HEIGHT = 250;

const listenerActive = ref(false);

const windowWidth = ref(0);
Expand All @@ -27,15 +29,25 @@ const componentHeightState = reactive<IComponentHeightState>({
* Computed maximum possible height of the table body of the ParticipantsTableBody component.
*/
const maxTableHeight = computed(() => {
return componentHeightState.screenHeight - (componentHeightState.navBarHeight + componentHeightState.tableHeadHeight + componentHeightState.mealListHeight + componentHeightState.mealOverviewHeight);
const height = componentHeightState.screenHeight - (componentHeightState.navBarHeight + componentHeightState.tableHeadHeight + componentHeightState.mealListHeight + componentHeightState.mealOverviewHeight);
if (height < MIN_TABLE_HEIGHT) {
return MIN_TABLE_HEIGHT;
}

return height;
});

/**
* Computed maximum possible height of the NoParticipations-component.
*/
const maxNoParticipationsHeight = computed(() => {
return componentHeightState.screenHeight - (componentHeightState.navBarHeight + componentHeightState.mealOverviewHeight);
})
const height = componentHeightState.screenHeight - (componentHeightState.navBarHeight + componentHeightState.mealOverviewHeight);
if (height < MIN_TABLE_HEIGHT) {
return MIN_TABLE_HEIGHT;
}

return height;
});

/**
* Computes the sum of margin-bottom and margin-top of an HTMLELement.
Expand Down

0 comments on commit 3359c1e

Please sign in to comment.