[hotfix] resizing widgets
This commit is contained in:
parent
d70a74479d
commit
973537fd9a
|
|
@ -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++;
|
||||
|
|
|
|||
|
|
@ -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() );
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue