react panels minor progress

This commit is contained in:
Torkel Ödegaard
2018-06-19 16:57:55 +02:00
parent aa5c9f199a
commit db52ea66bd
12 changed files with 24 additions and 28 deletions

View File

@@ -85,7 +85,7 @@ export class DashboardGrid extends React.Component<DashboardGridProps, any> {
this.dashboard.on('panel-added', this.triggerForceUpdate.bind(this));
this.dashboard.on('panel-removed', this.triggerForceUpdate.bind(this));
this.dashboard.on('repeats-processed', this.triggerForceUpdate.bind(this));
this.dashboard.on('view-mode-changed', this.triggerForceUpdate.bind(this));
this.dashboard.on('view-mode-changed', this.onViewModeChanged.bind(this));
this.dashboard.on('row-collapsed', this.triggerForceUpdate.bind(this));
this.dashboard.on('row-expanded', this.triggerForceUpdate.bind(this));
}
@@ -142,6 +142,10 @@ export class DashboardGrid extends React.Component<DashboardGridProps, any> {
}
}
onViewModeChanged(payload) {
this.setState({ animated: payload.fullscreen });
}
updateGridPos(item, layout) {
this.panelMap[item.i].updateGridPos(item);
@@ -165,9 +169,7 @@ export class DashboardGrid extends React.Component<DashboardGridProps, any> {
componentDidMount() {
setTimeout(() => {
this.setState(() => {
return { animated: true };
});
this.setState({ animated: true });
});
}