mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
PanelModel: expose isInView property to PanelModel (#16877)
This commit is contained in:
parent
2af69ccf0f
commit
bb64a0673d
@ -233,6 +233,7 @@ export class DashboardGrid extends PureComponent<Props> {
|
|||||||
for (const panel of this.props.dashboard.panels) {
|
for (const panel of this.props.dashboard.panels) {
|
||||||
const panelClasses = classNames({ 'react-grid-item--fullscreen': panel.fullscreen });
|
const panelClasses = classNames({ 'react-grid-item--fullscreen': panel.fullscreen });
|
||||||
const id = panel.id.toString();
|
const id = panel.id.toString();
|
||||||
|
panel.isInView = this.isInView(panel);
|
||||||
panelElements.push(
|
panelElements.push(
|
||||||
<div
|
<div
|
||||||
key={id}
|
key={id}
|
||||||
@ -247,7 +248,7 @@ export class DashboardGrid extends PureComponent<Props> {
|
|||||||
dashboard={this.props.dashboard}
|
dashboard={this.props.dashboard}
|
||||||
isEditing={panel.isEditing}
|
isEditing={panel.isEditing}
|
||||||
isFullscreen={panel.fullscreen}
|
isFullscreen={panel.fullscreen}
|
||||||
isInView={this.isInView(panel)}
|
isInView={panel.isInView}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
@ -23,6 +23,7 @@ const notPersistedProperties: { [str: string]: boolean } = {
|
|||||||
events: true,
|
events: true,
|
||||||
fullscreen: true,
|
fullscreen: true,
|
||||||
isEditing: true,
|
isEditing: true,
|
||||||
|
isInView: true,
|
||||||
hasRefreshed: true,
|
hasRefreshed: true,
|
||||||
cachedPluginOptions: true,
|
cachedPluginOptions: true,
|
||||||
plugin: true,
|
plugin: true,
|
||||||
@ -111,6 +112,7 @@ export class PanelModel {
|
|||||||
// non persisted
|
// non persisted
|
||||||
fullscreen: boolean;
|
fullscreen: boolean;
|
||||||
isEditing: boolean;
|
isEditing: boolean;
|
||||||
|
isInView: boolean;
|
||||||
hasRefreshed: boolean;
|
hasRefreshed: boolean;
|
||||||
events: Emitter;
|
events: Emitter;
|
||||||
cacheTimeout?: any;
|
cacheTimeout?: any;
|
||||||
|
Loading…
Reference in New Issue
Block a user