mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Merge pull request #13849 from grafana/mode-change-performance-changes
Reduce re-renderings when changing view modes
This commit is contained in:
commit
add2e4447e
@ -21,15 +21,14 @@ function GridWrapper({
|
||||
className,
|
||||
isResizable,
|
||||
isDraggable,
|
||||
isFullscreen,
|
||||
}) {
|
||||
if (size.width === 0) {
|
||||
console.log('size is zero!');
|
||||
}
|
||||
|
||||
const width = size.width > 0 ? size.width : lastGridWidth;
|
||||
if (width !== lastGridWidth) {
|
||||
onWidthChange();
|
||||
lastGridWidth = width;
|
||||
if (!isFullscreen && Math.abs(width - lastGridWidth) > 8) {
|
||||
onWidthChange();
|
||||
lastGridWidth = width;
|
||||
}
|
||||
}
|
||||
|
||||
return (
|
||||
@ -197,6 +196,7 @@ export class DashboardGrid extends React.Component<DashboardGridProps, any> {
|
||||
onDragStop={this.onDragStop}
|
||||
onResize={this.onResize}
|
||||
onResizeStop={this.onResizeStop}
|
||||
isFullscreen={this.props.dashboard.meta.fullscreen}
|
||||
>
|
||||
{this.renderPanels()}
|
||||
</SizedReactLayoutGrid>
|
||||
|
@ -36,7 +36,11 @@ export class Graph2 extends PureComponent<Props> {
|
||||
|
||||
export class TextOptions extends PureComponent<any> {
|
||||
render() {
|
||||
return <p>Text2 Options component</p>;
|
||||
return (
|
||||
<div className="section gf-form-group">
|
||||
<h5 className="section-heading">Draw Modes</h5>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user