web: fix js error breaking second use of add form (#72)
This commit is contained in:
parent
bb131f1b8c
commit
25b514b721
@ -431,11 +431,13 @@ registerChartHtml items =
|
|||||||
-- have to make sure plot is not called when our container (maincontent)
|
-- have to make sure plot is not called when our container (maincontent)
|
||||||
-- is hidden, eg with add form toggled
|
-- is hidden, eg with add form toggled
|
||||||
[hamlet|
|
[hamlet|
|
||||||
|
<div#register-chart style="width:600px;height:100px; margin-bottom:1em;">
|
||||||
<script type=text/javascript>
|
<script type=text/javascript>
|
||||||
if (document.getElementById('maincontent').style.display != 'none')
|
|
||||||
\$(document).ready(function() {
|
\$(document).ready(function() {
|
||||||
/* render chart */
|
/* render chart with flot, if visible */
|
||||||
\$.plot($('#register-chart'),
|
var chartdiv = $('#register-chart');
|
||||||
|
if (chartdiv.is(':visible'))
|
||||||
|
\$.plot(chartdiv,
|
||||||
[
|
[
|
||||||
[
|
[
|
||||||
$forall i <- items
|
$forall i <- items
|
||||||
@ -450,7 +452,6 @@ registerChartHtml items =
|
|||||||
}
|
}
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
<div#register-chart style="width:600px;height:100px; margin-bottom:1em;">
|
|
||||||
|]
|
|]
|
||||||
|
|
||||||
-- stringIfLongerThan :: Int -> String -> String
|
-- stringIfLongerThan :: Int -> String -> String
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user