"Add guard clause in onLayoutChange callback"

If not provided with a position change handler don't
send a resquest to persist updated layout position.  We
must do this until we resolve how we are going to persist
changes to precanned dashboards.
pull/10616/head
Andrew Watkins 2017-02-22 10:45:27 -06:00
parent 53005e715b
commit 98386d2995
1 changed files with 5 additions and 0 deletions

View File

@ -126,6 +126,11 @@ export const LayoutRenderer = React.createClass({
handleLayoutChange(layout) {
this.triggerWindowResize()
if (!this.props.onPositionChange) {
return
}
const newCells = this.props.cells.map((cell) => {
const l = layout.find((ly) => ly.i === cell.i)
const newLayout = {x: l.x, y: l.y, h: l.h, w: l.w}