From a092f1517558858536a873c2a82a35fba414057d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Campinas?= Date: Wed, 26 Oct 2016 10:22:58 +0100 Subject: [PATCH 1/2] corrected spy fullscreen mode --- src/ui/public/visualize/visualize.js | 7 +++++++ src/ui/public/visualize/visualize.less | 4 ++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/ui/public/visualize/visualize.js b/src/ui/public/visualize/visualize.js index 243cc9ffae4ef..5aa327c85810b 100644 --- a/src/ui/public/visualize/visualize.js +++ b/src/ui/public/visualize/visualize.js @@ -76,13 +76,20 @@ uiModules let applyClassNames = function () { let $visEl = getVisContainer(); + const $spyEl = getter('.visualize-spy-container')(); let fullSpy = ($scope.spy.mode && ($scope.spy.mode.fill || $scope.fullScreenSpy)); $visEl.toggleClass('spy-only', Boolean(fullSpy)); + if ($spyEl) { + $spyEl.toggleClass('only', Boolean(fullSpy)); + } $timeout(function () { if (shouldHaveFullSpy()) { $visEl.addClass('spy-only'); + if ($spyEl) { + $spyEl.addClass('only'); + } }; }, 0); }; diff --git a/src/ui/public/visualize/visualize.less b/src/ui/public/visualize/visualize.less index 05858172b3d69..0819dd98b9996 100644 --- a/src/ui/public/visualize/visualize.less +++ b/src/ui/public/visualize/visualize.less @@ -95,8 +95,8 @@ visualize-spy { margin-right: 5px; } - &.only { - .visualize-spy-container { + .visualize-spy-container { + &.only { height: auto; } } From 04034707da52259010f18e8524747458825a56c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Campinas?= Date: Fri, 28 Oct 2016 10:02:23 +0100 Subject: [PATCH 2/2] removed guard-clauses --- src/ui/public/visualize/visualize.js | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/ui/public/visualize/visualize.js b/src/ui/public/visualize/visualize.js index 5aa327c85810b..33772b61e38a7 100644 --- a/src/ui/public/visualize/visualize.js +++ b/src/ui/public/visualize/visualize.js @@ -50,6 +50,7 @@ uiModules let getVisEl = getter('.visualize-chart'); let getVisContainer = getter('.vis-container'); + let getSpyContainer = getter('.visualize-spy-container'); // Show no results message when isZeroHits is true and it requires search $scope.showNoResultsMessage = function () { @@ -76,20 +77,16 @@ uiModules let applyClassNames = function () { let $visEl = getVisContainer(); - const $spyEl = getter('.visualize-spy-container')(); + const $spyEl = getSpyContainer(); let fullSpy = ($scope.spy.mode && ($scope.spy.mode.fill || $scope.fullScreenSpy)); $visEl.toggleClass('spy-only', Boolean(fullSpy)); - if ($spyEl) { - $spyEl.toggleClass('only', Boolean(fullSpy)); - } + $spyEl.toggleClass('only', Boolean(fullSpy)); $timeout(function () { if (shouldHaveFullSpy()) { $visEl.addClass('spy-only'); - if ($spyEl) { - $spyEl.addClass('only'); - } + $spyEl.addClass('only'); }; }, 0); };