adding scope appy back (#14269) (#14286)

This commit is contained in:
Peter Pisljar 2017-10-04 12:29:03 +02:00 committed by GitHub
parent 1be4e00f7a
commit 3503aac2d1
4 changed files with 7 additions and 8 deletions

View file

@ -21,4 +21,4 @@
class="visualize-chart"></div>
<visualize-legend aria-hidden="{{!vis.type.isAccessible}}" ng-if="addLegend"></visualize-legend>
</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.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');

View file

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