simplify media manager panel height
commitd0eb8bfe20f8cf1dbc9e94d9eb82dcfbdf6af149
authorAndreas Gohr <andi@splitbrain.org>
Thu, 30 Mar 2023 13:44:56 +0000 (30 15:44 +0200)
committerAndreas Gohr <andi@splitbrain.org>
Thu, 30 Mar 2023 13:44:56 +0000 (30 15:44 +0200)
treec968d6914afdf9a8e03e8ddfc724e0399b340b70
parent66966f8dc7ed5b2244a68ce5e46a8c5294a13794
simplify media manager panel height

The height of the panel was calculated in JavaScript, trying to use the
remaining space. With larger headers that lead to a relatively small
area. In addition the height calculation behaved weirdly on certain
resolutions (in some templates) resulting in a decreasing height on each
image interaction.

This patch simply sets the panel height 60% of the browser window using
the vh unit (which was not available when the media manager was
written).

To keep backward compatibility and not accidentally break a bunch of
templates, the height is still set from JavaScript but only once instead
of updating it on every resize operation.

A proper refactoring of the whole media manager code is still something
we need to tackle in the future, but this change should make it slightly
better.
lib/scripts/media.js