mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 17:28:26 -04:00
removing $timeout
This commit is contained in:
parent
644453de19
commit
016ab7ef0d
2 changed files with 5 additions and 3 deletions
|
@ -11,6 +11,7 @@ module.exports = function VislibRenderbotFactory(Private, $injector) {
|
|||
_.class(VislibRenderbot).inherits(Renderbot);
|
||||
function VislibRenderbot(vis, $el, uiState) {
|
||||
VislibRenderbot.Super.call(this, vis, $el, uiState);
|
||||
this.refreshLegend = 0;
|
||||
this._createVis();
|
||||
}
|
||||
|
||||
|
@ -26,6 +27,7 @@ module.exports = function VislibRenderbotFactory(Private, $injector) {
|
|||
|
||||
if (this.chartData) {
|
||||
this.vislibVis.render(this.chartData, this.uiState);
|
||||
this.refreshLegend++;
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -49,6 +51,7 @@ module.exports = function VislibRenderbotFactory(Private, $injector) {
|
|||
this.chartData = this.buildChartData(esResponse);
|
||||
return AngularPromise.delay(1).then(() => {
|
||||
this.vislibVis.render(this.chartData, this.uiState);
|
||||
this.refreshLegend++;
|
||||
});
|
||||
};
|
||||
|
||||
|
|
|
@ -21,10 +21,9 @@ uiModules.get('kibana')
|
|||
$scope.$watch('renderbot.chartData', function (data) {
|
||||
if (!data) return;
|
||||
$scope.data = data;
|
||||
refresh();
|
||||
});
|
||||
|
||||
$scope.$watch('renderbot.vislibParams', () => {
|
||||
$scope.$watch('renderbot.refreshLegend', () => {
|
||||
refresh();
|
||||
});
|
||||
|
||||
|
@ -107,7 +106,7 @@ uiModules.get('kibana')
|
|||
const vislibVis = $scope.renderbot.vislibVis;
|
||||
if (!vislibVis.visConfig) {
|
||||
$scope.labels = [{ label: 'loading ...' }];
|
||||
return $timeout(refresh, 100);
|
||||
return;
|
||||
} // make sure vislib is defined at this point
|
||||
|
||||
if ($scope.uiState.get('vis.legendOpen') == null && $scope.vis.params.addLegend != null) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue