mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 17:28:26 -04:00
Backport #8439
[vislib/tilemap] ensure listeners are cleaned up With the new "rendered" event, the listener added in the handler was not being cleaned up. This changes it to use the handler's `binder`, which will cleanup the listener when `handler.destroy()` is called.
This commit is contained in:
parent
08c79b3606
commit
ee6f222496
1 changed files with 2 additions and 2 deletions
|
@ -103,7 +103,7 @@ export default function HandlerBaseClass(Private) {
|
|||
*/
|
||||
render() {
|
||||
const self = this;
|
||||
const charts = this.charts = [];
|
||||
const { binder, charts = [] } = this;
|
||||
const selection = d3.select(this.el);
|
||||
|
||||
selection.selectAll('*').remove();
|
||||
|
@ -125,7 +125,7 @@ export default function HandlerBaseClass(Private) {
|
|||
self.enable(event, chart);
|
||||
});
|
||||
|
||||
chart.events.on('rendered', () => {
|
||||
binder.on(chart.events, 'rendered', () => {
|
||||
loadedCount++;
|
||||
if (loadedCount === chartSelection.length) {
|
||||
// events from all charts are propagated to vis, we only need to fire renderComplete on one (first)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue