Skip to content

Commit

Permalink
[hotfix] resizing widgets
Browse files Browse the repository at this point in the history
  • Loading branch information
mistercrunch committed Nov 9, 2016
1 parent d70a744 commit 973537f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
6 changes: 3 additions & 3 deletions caravel/assets/javascripts/dashboard/Dashboard.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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++;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down Expand Up @@ -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() );
}
}

Expand Down

0 comments on commit 973537f

Please sign in to comment.