summaryrefslogtreecommitdiff
path: root/addons/web_graph/static/src
diff options
context:
space:
mode:
authorGery Debongnie <ged@openerp.com>2013-11-13 10:26:46 +0100
committerGery Debongnie <ged@openerp.com>2013-11-13 10:26:46 +0100
commit3be25d2c45b6869e30b7ad77413b50bd99f62822 (patch)
treea95e9ef5d6e33467ea2538654c35625e8879fb2f /addons/web_graph/static/src
parent3c0445479bf5ceaab5bb2b6f201daa787c53bb82 (diff)
[IMP] add redraw flag to basicview widget in addon web_graph
bzr revid: ged@openerp.com-20131113092646-182veoj027lkbdb6
Diffstat (limited to 'addons/web_graph/static/src')
-rw-r--r--addons/web_graph/static/src/js/graph.js11
1 files changed, 9 insertions, 2 deletions
diff --git a/addons/web_graph/static/src/js/graph.js b/addons/web_graph/static/src/js/graph.js
index 7ade3843bde..7f83d656059 100644
--- a/addons/web_graph/static/src/js/graph.js
+++ b/addons/web_graph/static/src/js/graph.js
@@ -74,7 +74,6 @@ instance.web_graph.GraphView = instance.web.View.extend({
this.pivot_table.show();
} else {
this.pivot_table.hide();
- this.chart_view.draw();
this.chart_view.show();
}
},
@@ -85,7 +84,6 @@ instance.web_graph.GraphView = instance.web.View.extend({
return this.get_data().done(function (data) {
self.pivot_table.set_data(data);
self.chart_view.set_data(data);
- self.pivot_table.draw();
self.display_data();
});
},
@@ -103,6 +101,9 @@ instance.web_graph.GraphView = instance.web.View.extend({
* and ChartView widget.
*/
var BasicDataView = instance.web.Widget.extend({
+
+ need_redraw: false,
+
init: function (fields, groupby, measure) {
this.fields = fields;
this.groupby = groupby;
@@ -113,9 +114,14 @@ var BasicDataView = instance.web.Widget.extend({
set_data : function (data) {
this.data = data;
+ this.need_redraw = true;
},
show: function () {
+ if (this.need_redraw) {
+ this.draw();
+ this.need_redraw = false;
+ }
this.$el.css('display', 'block');
},
@@ -170,6 +176,7 @@ var ChartView = BasicDataView.extend({
};
this.render = render_functions[mode];
+ this.need_redraw = true;
},
draw: function () {