[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.
This commit is contained in:
@@ -3056,3 +3056,7 @@ body {
|
||||
white-space: nowrap;
|
||||
padding-left: 10px;
|
||||
}
|
||||
|
||||
.nvtooltip thead {
|
||||
background-color: transparent;
|
||||
}
|
||||
|
||||
@@ -2605,3 +2605,6 @@ body
|
||||
width: 100px
|
||||
white-space: nowrap
|
||||
padding-left: 10px
|
||||
|
||||
.nvtooltip thead
|
||||
background-color: transparent
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user