[hotfix] resizing widgets

This commit is contained in:
Maxime Beauchemin 2016-11-09 14:52:39 -08:00
parent d70a74479d
commit 973537fd9a
2 changed files with 4 additions and 5 deletions

View File

@ -259,10 +259,10 @@ function dashboardContainer(dashboard) {
const id = parseInt(sliceId, 10);
let i = 0;
let slice = null;
while (i < this.slices.length) {
while (i < this.sliceObjects.length) {
// when the slice is found, assign to slice and break;
if (this.slices[i].data.slice_id === id) {
slice = this.slices[i];
if (this.sliceObjects[i].data.slice_id === id) {
slice = this.sliceObjects[i];
break;
}
i++;

View File

@ -5,7 +5,6 @@ import SliceCell from './SliceCell';
require('react-grid-layout/css/styles.css');
require('react-resizable/css/styles.css');
const ResponsiveReactGridLayout = WidthProvider(Responsive);
const propTypes = {
@ -47,7 +46,7 @@ class GridLayout extends React.Component {
onResizeStop(layout, oldItem, newItem) {
const newSlice = this.props.dashboard.getSlice(newItem.i);
if (oldItem.w !== newItem.w || oldItem.h !== newItem.h) {
this.setState({ layout }, () => { newSlice.resize(); });
this.setState({ layout }, () => newSlice.resize() );
}
}