From 5ef7a524c1a95fb7cba9e1720b581d6fad023cc8 Mon Sep 17 00:00:00 2001 From: Peter Pisljar Date: Mon, 21 Nov 2016 17:56:06 +0100 Subject: [PATCH] fixing error when vis has no spy panel (#9115) --- src/ui/public/visualize/visualize.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/ui/public/visualize/visualize.js b/src/ui/public/visualize/visualize.js index b0654b4c44918..a0c07675da311 100644 --- a/src/ui/public/visualize/visualize.js +++ b/src/ui/public/visualize/visualize.js @@ -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));