[FIX] web: hide dashboard tooltip on page change

Go to CRM/Sales/Team Pileline. Place your cursor on the chart, a tooltip
appears, move your cusror away, the tooltip disappear. Now clic anywhere
on the interface so the page change (i.e. on "x Open Opportunities") and
quickly while the page loads place your cursor on the tooltip, it
appears but when the page change it doesn't disappear.

The problem here is that the graph element is removed from the DOM which
prevent the correct handling of the `mousehover` event used internally
by nv.d3 to show/hide the related tooltip.

The solution is to manually hide the tooltip when the graph element is
removed from the DOM.

opw-2042286

closes odoo/odoo#35172

Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
This commit is contained in:
Julien Castiaux
2019-07-25 09:14:45 +00:00
parent 6e759184d6
commit 6d9dabd5d9
@@ -2530,6 +2530,7 @@ var JournalDashboardGraph = AbstractField.extend({
* Called when the field is detached from the DOM.
*/
on_detach_callback: function () {
this.chart.tooltip.hidden(true);
this._isInDOM = false;
},