dataviz: force graph redraw on initial display (#52959)

This commit is contained in:
Frédéric Péters 2021-04-11 17:33:35 +02:00
parent 3879710d48
commit 98379eb839
1 changed files with 2 additions and 2 deletions

View File

@ -9,7 +9,7 @@
<script>
$(function() {
var last_width = 1;
$(window).on('load resize gadjo:sidepage-toggled', function() {
$(window).on('load resize gadjo:sidepage-toggled combo:resize-graphs', function() {
var chart_cell = $('#chart-{{cell.id}}').parent();
var new_width = Math.floor($(chart_cell).width());
var ratio = new_width / last_width;
@ -18,7 +18,7 @@ $(function() {
"{% url 'combo-dataviz-graph' cell=cell.id %}?width=" + new_width);
last_width = new_width;
}
});
}).trigger('combo:resize-graphs');
});
</script>
{% endif %}