From f19210ee08448aebbb5e378067aa5c903b8f45f6 Mon Sep 17 00:00:00 2001 From: Martin Geubelle Date: Tue, 26 Jan 2016 14:48:45 +0100 Subject: [PATCH] [FIX] web: properly remove nvd3 tooltips We fixed it for the graph view in 6bdf72bac5f6e8 but this needs to be fixed for every views. --- addons/web/static/src/js/action_manager.js | 3 +++ addons/web/static/src/js/views/graph_view.js | 4 ---- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/addons/web/static/src/js/action_manager.js b/addons/web/static/src/js/action_manager.js index 2337583b7f9..5eb5aaa9891 100644 --- a/addons/web/static/src/js/action_manager.js +++ b/addons/web/static/src/js/action_manager.js @@ -180,6 +180,9 @@ var ViewManagerAction = WidgetAction.extend({ * @return {jQuery} the view_manager's $el */ detach: function() { + // Hack to remove badly inserted nvd3 tooltips ; should be removed when upgrading nvd3 lib + $('body > .nvtooltip').remove(); + return this.widget.$el.detach(); }, /** diff --git a/addons/web/static/src/js/views/graph_view.js b/addons/web/static/src/js/views/graph_view.js index f8f1bba909a..8a604640fc9 100644 --- a/addons/web/static/src/js/views/graph_view.js +++ b/addons/web/static/src/js/views/graph_view.js @@ -19,10 +19,6 @@ var GraphView = View.extend({ icon: 'fa-bar-chart', view_type: 'graph', - on_detach_callback: function () { - $('body > .nvtooltip').remove(); - }, - init: function(parent, dataset, view_id, options) { this._super(parent, dataset, view_id, options);