web: prevent flot js error which broke add form fields after adding a transaction (#72)

This commit is contained in:
Simon Michael 2012-01-03 12:14:22 +00:00
parent 7f60e3504c
commit 03359b48d3

View File

@ -389,11 +389,14 @@ $forall p <- tpostings t
-- | Generate javascript/html for a register balance line chart based on
-- the provided "TransactionsReportItem"s.
registerChartHtml items = [$hamlet|
registerChartHtml items =
-- have to make sure plot is not called when our container (maincontent)
-- is hidden, eg with add form toggled
[$hamlet|
<script type=text/javascript>
if (document.getElementById('maincontent').style.display == 'block')
\$(document).ready(function() {
/* render chart */
/* if (\$('#register-chart')) */
\$.plot($('#register-chart'),
[
[