Skip to content

Commit

Permalink
resize was not detected correctly (#13239)
Browse files Browse the repository at this point in the history
  • Loading branch information
ppisljar committed Aug 4, 2017
1 parent 47f800d commit ebf45bb
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 7 deletions.
6 changes: 3 additions & 3 deletions src/core_plugins/tile_map/public/maps_visualization.js
Original file line number Diff line number Diff line change
Expand Up @@ -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') {
Expand All @@ -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);

Expand Down
4 changes: 1 addition & 3 deletions src/ui/public/visualize/visualization.js
Original file line number Diff line number Diff line change
Expand Up @@ -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(() => {
Expand Down
1 change: 0 additions & 1 deletion src/ui/public/visualize/visualize.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit ebf45bb

Please sign in to comment.