Skip to content

Commit

Permalink
Bring back panel expand: avoid mget calls for every visualization aft…
Browse files Browse the repository at this point in the history
…er panel collapse (#10043)

* Avoid mget calls for every visualization after panel collapse

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

* use ng-hide check, not width check
  • Loading branch information
stacey-gammon authored Feb 6, 2017
1 parent 912454a commit ae20e40
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
4 changes: 3 additions & 1 deletion src/core_plugins/kibana/public/dashboard/dashboard.html
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ <h2>This dashboard is empty. Let's fill it up!</h2>
</div>

<dashboard-grid
ng-if="!hasExpandedPanel()"
ng-show="!hasExpandedPanel()"
on-panel-removed="onPanelRemoved"
panels="state.panels"
get-vis-click-handler="filterBarClickHandler(state)"
Expand All @@ -81,4 +81,6 @@ <h2>This dashboard is empty. Let's fill it up!</h2>
save-state="saveState"
create-child-ui-state="createChildUiState"
toggle-expand="toggleExpandPanel(expandedPanel.panelIndex)">
</dashboard-panel>

</dashboard-app>
4 changes: 4 additions & 0 deletions src/core_plugins/kibana/public/dashboard/grid.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
3 changes: 0 additions & 3 deletions src/core_plugins/kibana/public/dashboard/panel/panel.html
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down

0 comments on commit ae20e40

Please sign in to comment.