mirror of
https://github.com/kemko/nomad.git
synced 2026-01-04 17:35:43 +03:00
Guard against the element already being destroyed
Since DOM code is in a run.next, it's possible that between the DOM code being queued and running the element is destroyed. So the DOM code needs to guard against this using the isDestroyed API.
This commit is contained in:
@@ -325,9 +325,11 @@ export default Component.extend(WindowResizable, {
|
||||
},
|
||||
|
||||
mountD3Elements() {
|
||||
d3.select(this.element.querySelector('.x-axis')).call(this.get('xAxis'));
|
||||
d3.select(this.element.querySelector('.y-axis')).call(this.get('yAxis'));
|
||||
d3.select(this.element.querySelector('.y-gridlines')).call(this.get('yGridlines'));
|
||||
if (!this.get('isDestroyed') && !this.get('isDestroying')) {
|
||||
d3.select(this.element.querySelector('.x-axis')).call(this.get('xAxis'));
|
||||
d3.select(this.element.querySelector('.y-axis')).call(this.get('yAxis'));
|
||||
d3.select(this.element.querySelector('.y-gridlines')).call(this.get('yGridlines'));
|
||||
}
|
||||
},
|
||||
|
||||
windowResizeHandler() {
|
||||
|
||||
Reference in New Issue
Block a user