address code review comments

This commit is contained in:
Stacey Gammon 2017-01-03 11:06:18 -05:00
parent 9200cb1f3b
commit e3a8caecaa
3 changed files with 6 additions and 7 deletions

View file

@ -5,8 +5,7 @@
</span>
<div class="btn-group">
<a aria-label="Expand" ng-click="toggleExpand()">
<span ng-show="!isExpanded" class="fa fa-expand"></span>
<span ng-show="isExpanded" class="fa fa-compress"></span>
<span class="fa" ng-class="{'fa-expand': !isExpanded, 'fa-compress': isExpanded}"></span>
</a>
<a aria-label="Edit" ng-show="!isFullScreenMode && editUrl" ng-href="{{::editUrl}}">
<i aria-hidden="true" class="fa fa-pencil"></i>

View file

@ -59,9 +59,9 @@
<p>Click the <a class="btn btn-xs navbtn-inverse" ng-click="kbnTopNav.open('add'); toggleAddVisualization = !toggleAddVisualization" aria-label="Add visualization">Add</a> button in the menu bar above to add a visualization to the dashboard. <br/>If you haven't setup a visualization yet visit the <a href="#/visualize" title="Visualize">"Visualize"</a> tab to create your first visualization.</p>
</div>
<dashboard-grid ng-if="expandedPanel === null"></dashboard-grid>
<dashboard-grid ng-if="!hasExpandedPanel()"></dashboard-grid>
<dashboard-panel ng-if="expandedPanel !== null"
<dashboard-panel ng-if="hasExpandedPanel()"
panel="expandedPanel"
is-full-screen-mode="!chrome.getVisible()"
state="state"

View file

@ -209,13 +209,13 @@ app.directive('dashboardApp', function (Notifier, courier, AppState, timefilter,
}
$scope.expandedPanel = null;
$scope.hasExpandedPanel = () => $scope.expandedPanel !== null;
$scope.toggleExpandPanel = (panelIndex) => {
if ($scope.expandedPanel && $scope.expandedPanel.panelIndex === panelIndex) {
$scope.expandedPanel = null;
} else {
$scope.expandedPanel = $scope.state.panels.find(function (panel) {
return panel.panelIndex === panelIndex;
});
$scope.expandedPanel =
$scope.state.panels.find((panel) => panel.panelIndex === panelIndex);
}
};