PanelModel: expose isInView property to PanelModel (#16877)

This commit is contained in:
Ryan McKinley 2019-05-03 12:55:22 -07:00 committed by GitHub
parent 2af69ccf0f
commit bb64a0673d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 1 deletions

View File

@ -233,6 +233,7 @@ export class DashboardGrid extends PureComponent<Props> {
for (const panel of this.props.dashboard.panels) {
const panelClasses = classNames({ 'react-grid-item--fullscreen': panel.fullscreen });
const id = panel.id.toString();
panel.isInView = this.isInView(panel);
panelElements.push(
<div
key={id}
@ -247,7 +248,7 @@ export class DashboardGrid extends PureComponent<Props> {
dashboard={this.props.dashboard}
isEditing={panel.isEditing}
isFullscreen={panel.fullscreen}
isInView={this.isInView(panel)}
isInView={panel.isInView}
/>
</div>
);

View File

@ -23,6 +23,7 @@ const notPersistedProperties: { [str: string]: boolean } = {
events: true,
fullscreen: true,
isEditing: true,
isInView: true,
hasRefreshed: true,
cachedPluginOptions: true,
plugin: true,
@ -111,6 +112,7 @@ export class PanelModel {
// non persisted
fullscreen: boolean;
isEditing: boolean;
isInView: boolean;
hasRefreshed: boolean;
events: Emitter;
cacheTimeout?: any;