mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 09:19:04 -04:00
adding onRenderComplete method
This commit is contained in:
parent
fc78562c2b
commit
451ab9a1db
1 changed files with 10 additions and 0 deletions
|
@ -40,6 +40,8 @@ export default function VisFactory(Notifier, Private) {
|
|||
|
||||
this.setState(state);
|
||||
this.setUiState(uiState);
|
||||
|
||||
this.on('renderComplete', () => this._renderComplete = true);
|
||||
}
|
||||
|
||||
Vis.convertOldState = function (type, oldState) {
|
||||
|
@ -171,6 +173,14 @@ export default function VisFactory(Notifier, Private) {
|
|||
return this.type.implementsRenderComplete;
|
||||
};
|
||||
|
||||
Vis.prototype.onRenderComplete = function (cb) {
|
||||
this.on('renderComplete', cb);
|
||||
if (this._renderComplete) {
|
||||
// guarantees that caller receives event in case visualization already finished rendering
|
||||
this.emit('renderComplete');
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Currently this is only used to extract map-specific information
|
||||
* (e.g. mapZoom, mapCenter).
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue