adding scope appy back (#14269)

This commit is contained in:
Peter Pisljar 2017-10-04 07:32:14 +02:00 committed by Chris Roberson
parent 44a71071ac
commit 51b6b51aac
4 changed files with 7 additions and 8 deletions

View file

@ -21,4 +21,4 @@
class="visualize-chart"></div> class="visualize-chart"></div>
<visualize-legend aria-hidden="{{!vis.type.isAccessible}}" ng-if="addLegend"></visualize-legend> <visualize-legend aria-hidden="{{!vis.type.isAccessible}}" ng-if="addLegend"></visualize-legend>
</div> </div>
<visualize-spy ng-if="shouldShowSpyPanel()"></visualize-spy> <visualize-spy ng-if="showSpyPanel"></visualize-spy>

View file

@ -35,10 +35,6 @@ uiModules
$scope.addLegend = false; $scope.addLegend = false;
$scope.shouldShowSpyPanel = () => {
return $scope.vis.type.requiresSearch && $scope.showSpyPanel;
};
// Show no results message when isZeroHits is true and it requires search // Show no results message when isZeroHits is true and it requires search
$scope.showNoResultsMessage = function () { $scope.showNoResultsMessage = function () {
const requiresSearch = _.get($scope, 'vis.type.requiresSearch'); const requiresSearch = _.get($scope, 'vis.type.requiresSearch');

View file

@ -6,7 +6,7 @@
ui-state="uiState" ui-state="uiState"
class="vis-editor-content" class="vis-editor-content"
search-source="savedObj.searchSource" search-source="savedObj.searchSource"
show-spy-panel="showSpyPanel" show-spy-panel="shouldShowSpyPanel()"
/> />
<visualization <visualization
ng-if="editorMode==false" ng-if="editorMode==false"
@ -15,6 +15,6 @@
vis-data="visData" vis-data="visData"
ui-state="uiState" ui-state="uiState"
search-source="savedObj.searchSource" search-source="savedObj.searchSource"
show-spy-panel="showSpyPanel" show-spy-panel="shouldShowSpyPanel()"
/> />

View file

@ -68,7 +68,10 @@ uiModules
} }
// spy panel is supported only with courier request handler // 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(); if (!$scope.appState) $scope.appState = getAppState();