web: prevent flot js error which broke add form fields after adding a transaction (#72)
This commit is contained in:
parent
7f60e3504c
commit
03359b48d3
@ -389,11 +389,14 @@ $forall p <- tpostings t
|
|||||||
|
|
||||||
-- | Generate javascript/html for a register balance line chart based on
|
-- | Generate javascript/html for a register balance line chart based on
|
||||||
-- the provided "TransactionsReportItem"s.
|
-- 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>
|
<script type=text/javascript>
|
||||||
|
if (document.getElementById('maincontent').style.display == 'block')
|
||||||
\$(document).ready(function() {
|
\$(document).ready(function() {
|
||||||
/* render chart */
|
/* render chart */
|
||||||
/* if (\$('#register-chart')) */
|
|
||||||
\$.plot($('#register-chart'),
|
\$.plot($('#register-chart'),
|
||||||
[
|
[
|
||||||
[
|
[
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user