From 51b6b51aac34941448706d8eb8fbad8076d2c81d Mon Sep 17 00:00:00 2001 From: Peter Pisljar Date: Wed, 4 Oct 2017 07:32:14 +0200 Subject: [PATCH] adding scope appy back (#14269) --- src/ui/public/visualize/visualization.html | 2 +- src/ui/public/visualize/visualization.js | 4 ---- src/ui/public/visualize/visualize.html | 4 ++-- src/ui/public/visualize/visualize.js | 5 ++++- 4 files changed, 7 insertions(+), 8 deletions(-) diff --git a/src/ui/public/visualize/visualization.html b/src/ui/public/visualize/visualization.html index 300b7ec8b0f4d..77010a3460c49 100644 --- a/src/ui/public/visualize/visualization.html +++ b/src/ui/public/visualize/visualization.html @@ -21,4 +21,4 @@

No results found

class="visualize-chart"> - + diff --git a/src/ui/public/visualize/visualization.js b/src/ui/public/visualize/visualization.js index d3f19fbf57c5a..d37f2b57b7232 100644 --- a/src/ui/public/visualize/visualization.js +++ b/src/ui/public/visualize/visualization.js @@ -35,10 +35,6 @@ uiModules $scope.addLegend = false; - $scope.shouldShowSpyPanel = () => { - return $scope.vis.type.requiresSearch && $scope.showSpyPanel; - }; - // Show no results message when isZeroHits is true and it requires search $scope.showNoResultsMessage = function () { const requiresSearch = _.get($scope, 'vis.type.requiresSearch'); diff --git a/src/ui/public/visualize/visualize.html b/src/ui/public/visualize/visualize.html index 99bf87592a64e..f8bda15cf3fab 100644 --- a/src/ui/public/visualize/visualize.html +++ b/src/ui/public/visualize/visualize.html @@ -6,7 +6,7 @@ ui-state="uiState" class="vis-editor-content" search-source="savedObj.searchSource" - show-spy-panel="showSpyPanel" + show-spy-panel="shouldShowSpyPanel()" /> diff --git a/src/ui/public/visualize/visualize.js b/src/ui/public/visualize/visualize.js index 7a6c5abbf94cc..beb7ab9273709 100644 --- a/src/ui/public/visualize/visualize.js +++ b/src/ui/public/visualize/visualize.js @@ -68,7 +68,10 @@ uiModules } // spy panel is supported only with courier request handler - if (!$scope.vis.type.requestHandler !== 'courier') $scope.showSpyPanel = false; + $scope.shouldShowSpyPanel = () => { + if ($scope.vis.type.requestHandler !== 'courier') return false; + return $scope.vis.type.requiresSearch && $scope.showSpyPanel; + }; if (!$scope.appState) $scope.appState = getAppState();