summaryrefslogtreecommitdiff
path: root/addons/web/static/src/js/views/graph_widget.js
diff options
context:
space:
mode:
authorqsm-odoo <qsm@odoo.com>2016-11-16 16:40:10 +0100
committerqsm-odoo <qsm@odoo.com>2016-11-16 17:27:40 +0100
commit86252428846607cd5f4b18cef8de49a8cd0b151a (patch)
tree8ddb85a8792b15f24d339f0a3e1f6a24e2a705a0 /addons/web/static/src/js/views/graph_widget.js
parent164b8ed01a96c860cf758514abfd50ba349e990c (diff)
[FIX] web: properly destroy nvtooltips when switching views
If the graph view was left while a nvtooltip was shown (thanks to keyboard shortcuts or during loading time), the nvtooltip remained and was only destroyed when leaving the action. Now they are automatically removed with the view as they are now placed inside of them instead of inside the body element.
Diffstat (limited to 'addons/web/static/src/js/views/graph_widget.js')
-rw-r--r--addons/web/static/src/js/views/graph_widget.js11
1 files changed, 9 insertions, 2 deletions
diff --git a/addons/web/static/src/js/views/graph_widget.js b/addons/web/static/src/js/views/graph_widget.js
index d0cd362487d..73b9c6be406 100644
--- a/addons/web/static/src/js/views/graph_widget.js
+++ b/addons/web/static/src/js/views/graph_widget.js
@@ -97,7 +97,8 @@ return Widget.extend({
"there is no active filter in the search bar."),
}));
} else {
- this['display_' + this.mode]();
+ var chart = this['display_' + this.mode]();
+ chart.tooltip.chartContainer(this.$el[0]);
}
},
display_bar: function () {
@@ -181,6 +182,8 @@ return Widget.extend({
chart(svg);
this.to_remove = chart.update;
nv.utils.onWindowResize(chart.update);
+
+ return chart;
},
display_pie: function () {
var data = [],
@@ -231,6 +234,8 @@ return Widget.extend({
chart(svg);
this.to_remove = chart.update;
nv.utils.onWindowResize(chart.update);
+
+ return chart;
},
display_line: function () {
if (this.data.length < 2) {
@@ -308,7 +313,9 @@ return Widget.extend({
chart(svg);
this.to_remove = chart.update;
- nv.utils.onWindowResize(chart.update);
+ nv.utils.onWindowResize(chart.update);
+
+ return chart;
},
destroy: function () {
nv.utils.offWindowResize(this.to_remove);