fixing error when vis has no spy panel (#9115)

This commit is contained in:
Peter Pisljar 2016-11-21 17:56:06 +01:00 committed by GitHub
parent f0a8887f7b
commit 5ef7a524c1

View file

@ -76,8 +76,10 @@ uiModules
$scope.spy.mode = ($scope.uiState) ? $scope.uiState.get('spy.mode', {}) : {};
let applyClassNames = function () {
let $visEl = getVisContainer();
const $visEl = getVisContainer();
const $spyEl = getSpyContainer();
if (!$spyEl) return;
let fullSpy = ($scope.spy.mode && ($scope.spy.mode.fill || $scope.fullScreenSpy));
$visEl.toggleClass('spy-only', Boolean(fullSpy));