Bring back panel expand: avoid mget calls for every visualization after panel collapse (#10197)

Backports PR #10043

**Commit 1:**
Avoid mget calls for every visualization after panel collapse

This will still cause the data to refresh (an msearch call).

* Original sha: fb73d3491c
* Authored by Stacey Gammon <gammon@elastic.co> on 2017-01-24T17:26:43Z

**Commit 2:**
use ng-hide check, not width check

* Original sha: 23883027bd
* Authored by Stacey Gammon <gammon@elastic.co> on 2017-02-06T16:09:58Z
This commit is contained in:
jasper 2017-02-07 13:51:19 -05:00 committed by Stacey Gammon
parent 23ab0f2e4a
commit 5bc910da96
3 changed files with 7 additions and 4 deletions

View file

@ -61,7 +61,7 @@
</div>
<dashboard-grid
ng-if="!hasExpandedPanel()"
ng-show="!hasExpandedPanel()"
on-panel-removed="onPanelRemoved"
panels="state.panels"
get-vis-click-handler="filterBarClickHandler(state)"
@ -81,4 +81,6 @@
save-state="saveState"
create-child-ui-state="createChildUiState"
toggle-expand="toggleExpandPanel(expandedPanel.panelIndex)">
</dashboard-panel>
</dashboard-app>

View file

@ -209,6 +209,10 @@ app.directive('dashboardGrid', function ($compile, Notifier) {
// then tell gridster to "reflow" -- which is definitely not supported.
// we may need to consider using a different library
function reflowGridster() {
if ($container.hasClass('ng-hide')) {
return;
}
// https://github.com/gcphost/gridster-responsive/blob/97fe43d4b312b409696b1d702e1afb6fbd3bba71/jquery.gridster.js#L1208-L1235
const g = gridster;

View file

@ -4,12 +4,9 @@
{{::savedObj.title}}
</span>
<div class="btn-group">
<!--
Pulling out due to https://github.com/elastic/kibana/issues/9766. Uncomment when fixed.
<a aria-label="Expand" ng-click="toggleExpand()">
<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>
</a>