Skip to content
This repository has been archived by the owner on Nov 4, 2023. It is now read-only.

Commit

Permalink
fix: fullsize popup cropped at the bottom (#508)
Browse files Browse the repository at this point in the history
fixes #423
  • Loading branch information
akloeckner authored Oct 29, 2020
1 parent 1d21e7b commit 3cfaef8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
7 changes: 7 additions & 0 deletions scripts/controllers/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,13 @@ App.controller('Main', function ($scope, $timeout, $location, Api) {
}
}

function innerHeightToCSS () {
const vh = window.innerHeight * 0.01;
document.documentElement.style.setProperty('--vh', `${vh}px`);
}
innerHeightToCSS();
window.addEventListener('resize', debounce(innerHeightToCSS, 250));

$scope.entityClick = function (page, item, entity) {
if (typeof item.action === 'function') {
return callFunction(item.action, [item, entity]);
Expand Down
2 changes: 1 addition & 1 deletion styles/main.less
Original file line number Diff line number Diff line change
Expand Up @@ -1328,7 +1328,7 @@ camera_stream {
/* min-width, if container is sized by title */
min-width: calc(100% - 2*@popupPadding);
/* absolute max-height */
max-height: calc(100vh - @popupTitleHeight - 2*@popupMargin - 2*@popupPadding);
max-height: calc(100*var(--vh, 1vh) - @popupTitleHeight - 2*@popupMargin - 2*@popupPadding);
/* default size to fill screen */
height: 100vh;
width: 100vw;
Expand Down

0 comments on commit 3cfaef8

Please sign in to comment.