[FIX] fix pivottable and chartview widget to use their template instead of hardcoded divs (addon web_graph)
bzr revid: ged@openerp.com-20131112084955-2x8o57ndln0xx0nx
This commit is contained in:
parent
6ecbf2ef80
commit
d947299a74
|
@ -67,8 +67,8 @@ instance.web_graph.GraphView = instance.web.View.extend({
|
|||
});
|
||||
|
||||
this.chart_view.set_measure(this.measure);
|
||||
this.pivot_table.appendTo('.graph_pivot');
|
||||
this.chart_view.appendTo('.graph_chart');
|
||||
this.pivot_table.appendTo('.graph_main_content');
|
||||
this.chart_view.appendTo('.graph_main_content');
|
||||
this.chart_view.hide();
|
||||
this.get_data().done(this.pivot_table.draw);
|
||||
|
||||
|
@ -127,11 +127,11 @@ var ChartView = instance.web.Widget.extend({
|
|||
measure: null,
|
||||
|
||||
show: function () {
|
||||
$('.graph_chart').css('display', 'block');
|
||||
this.$el.css('display', 'block');
|
||||
},
|
||||
|
||||
hide: function () {
|
||||
$('.graph_chart').css('display', 'none');
|
||||
this.$el.css('display', 'none');
|
||||
},
|
||||
|
||||
set_measure: function (measure) {
|
||||
|
@ -139,8 +139,8 @@ var ChartView = instance.web.Widget.extend({
|
|||
},
|
||||
|
||||
draw: function (data, mode) {
|
||||
$('.graph_chart').empty();
|
||||
$('.graph_chart').append('<svg></svg>');
|
||||
this.$el.empty();
|
||||
this.$el.append('<svg></svg>');
|
||||
|
||||
switch (mode) {
|
||||
case 'bar_chart':
|
||||
|
|
|
@ -15,8 +15,6 @@
|
|||
|
||||
</div>
|
||||
<div class="graph_main_content">
|
||||
<div class="graph_pivot"></div>
|
||||
<div class="graph_chart"></div>
|
||||
</div>
|
||||
</t>
|
||||
|
||||
|
@ -25,6 +23,7 @@
|
|||
</t>
|
||||
|
||||
<t t-name="chart_view">
|
||||
<div class="graph_chart"></div>
|
||||
</t>
|
||||
|
||||
</templates>
|
||||
|
|
Loading…
Reference in New Issue