Only apply SVG responsiveness when not rendered in compact mode

Don't let SVGs grow vertically in when displayed in the dashboard, to avoid wasted space
This commit is contained in:
Matthias Jentsch 2014-08-28 16:52:02 +02:00
parent 648debff88
commit e799d65d3f
4 changed files with 23 additions and 12 deletions

View File

@ -22,6 +22,11 @@ use Icinga\Chart\Unit\StaticAxis;
class Monitoring_ChartController extends Controller
{
public function init()
{
$this->view->compact = $this->_request->getParam('view') === 'compact';
}
public function testAction()
{
$this->chart = new GridChart();

View File

@ -1,6 +1,9 @@
<div class="chart">
<?=
$chart->render();
?>
</div>
<?php if (! $this->compact) { ?>
<div class="svg-container-responsive">
<?= $chart->render(); ?>
<?= isset($chart2) ? $chart2->render() : ''; ?>
</div>
<?php } else { ?>
<?= $chart->render(); ?>
<?php } ?>

View File

@ -1,6 +1,8 @@
<div class="chart">
<?=
$chart->render();
?>
</div>
<?php if (! $this->compact) { ?>
<div class="svg-container-responsive">
<?= $chart->render(); ?>
</div>
<?php } else { ?>
<?= $chart->render(); ?>
<?php } ?>

View File

@ -175,6 +175,7 @@ ul.tree li a.error:hover {
}
/* charts should grow as much as possible but never beyond the current viewport's size */
div.chart {
height: 90vh;
.svg-container-responsive {
padding: 1.5em;
height: 80vh;
}