From 83b005a8ddad05e96e25834ebf2f10032b7947a6 Mon Sep 17 00:00:00 2001 From: ppisljar Date: Tue, 1 Aug 2017 10:37:24 +0200 Subject: [PATCH] resize was not detected correctly --- src/core_plugins/tile_map/public/maps_visualization.js | 6 +++--- src/ui/public/visualize/visualization.js | 4 +--- src/ui/public/visualize/visualize.js | 1 - 3 files changed, 4 insertions(+), 7 deletions(-) diff --git a/src/core_plugins/tile_map/public/maps_visualization.js b/src/core_plugins/tile_map/public/maps_visualization.js index efb86741ce133..cc1936c8c1719 100644 --- a/src/core_plugins/tile_map/public/maps_visualization.js +++ b/src/core_plugins/tile_map/public/maps_visualization.js @@ -42,6 +42,9 @@ export function MapsVisualizationProvider(serviceSettings, Notifier, getAppState return new Promise(async(resolve) => { await this._kibanaMapReady; + if (status.resize) { + this._kibanaMap.resize(); + } if (status.params || status.aggs) await this._updateParams(); if (esResponse && typeof esResponse.geohashGridAgg === 'undefined') { @@ -54,9 +57,6 @@ export function MapsVisualizationProvider(serviceSettings, Notifier, getAppState if (status.uiState) { this._kibanaMap.useUiStateFromVisualization(this.vis); } - if (status.resize) { - this._kibanaMap.resize(); - } this._doRenderComplete(resolve); diff --git a/src/ui/public/visualize/visualization.js b/src/ui/public/visualize/visualization.js index e54108a4f1fe4..54e32e31332e4 100644 --- a/src/ui/public/visualize/visualization.js +++ b/src/ui/public/visualize/visualization.js @@ -98,12 +98,10 @@ uiModules }); const Visualization = $scope.vis.type.visualization; - - //todo: make this not a jquery element const visualization = new Visualization(getVisEl()[0], $scope.vis); - const renderFunction = _.debounce(() => { + $scope.vis.size = [$el.width(), $el.height()]; const status = getUpdateStatus($scope); visualization.render($scope.visData, status) .then(() => { diff --git a/src/ui/public/visualize/visualize.js b/src/ui/public/visualize/visualize.js index a97422455ff62..5b64c87d10fff 100644 --- a/src/ui/public/visualize/visualize.js +++ b/src/ui/public/visualize/visualize.js @@ -137,7 +137,6 @@ uiModules let resizeInit = false; const resizeFunc = _.debounce(() => { if (!resizeInit) return resizeInit = true; - $scope.vis.size = [$el.width(), $el.height()]; $scope.$broadcast('render'); }, 200); resizeChecker.on('resize', resizeFunc);