Skip to content

Commit

Permalink
adding resize call to visualization
Browse files Browse the repository at this point in the history
  • Loading branch information
ppisljar committed May 22, 2017
1 parent fbac178 commit 2da49f1
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/ui/public/visualize/visualization.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,14 @@ import 'ui/visualize/visualize.less';
import 'ui/visualize/visualize_legend';
import _ from 'lodash';
import { uiModules } from 'ui/modules';
import { ResizeCheckerProvider } from 'ui/resize_checker';
import visualizationTemplate from 'ui/visualize/visualization.html';
import 'angular-sanitize';




uiModules
.get('kibana/directive', ['ngSanitize'])
.directive('visualization', function (Notifier, SavedVis, indexPatterns, Private, config, $timeout) {
const ResizeChecker = Private(ResizeCheckerProvider);

return {
restrict: 'E',
Expand All @@ -25,6 +24,7 @@ uiModules
template: visualizationTemplate,
link: function ($scope, $el, attr, renderCounter) {
const minVisChartHeight = 180;
const resizeChecker = new ResizeChecker($el);

$scope.showSpyPanel = $scope.vis && $scope.vis.showSpyPanel || false;

Expand Down Expand Up @@ -126,6 +126,10 @@ uiModules
visualization.destroy();
});

resizeChecker.on('resize', () => {
visualization.resize();
});


function jQueryGetter(selector) {
return function () {
Expand Down

0 comments on commit 2da49f1

Please sign in to comment.