diff --git a/client/app/scripts/actions/app-actions.js b/client/app/scripts/actions/app-actions.js index c83a8bf48..03646ed96 100644 --- a/client/app/scripts/actions/app-actions.js +++ b/client/app/scripts/actions/app-actions.js @@ -232,8 +232,11 @@ export function clickForceRelayout() { }; } -export function toggleGridMode(enabled) { +export function toggleGridMode(enabledArgument) { return (dispatch, getState) => { + const enabled = (enabledArgument === undefined) ? + !getState().get('gridMode') : + enabledArgument; dispatch({ type: ActionTypes.SET_GRID_MODE, enabled diff --git a/client/app/scripts/charts/nodes-chart.js b/client/app/scripts/charts/nodes-chart.js index 301b36576..943395b83 100644 --- a/client/app/scripts/charts/nodes-chart.js +++ b/client/app/scripts/charts/nodes-chart.js @@ -41,8 +41,8 @@ class NodesChart extends React.Component { scale: 1, selectedNodeScale: d3.scale.linear(), hasZoomed: false, - height: 0, - width: 0, + height: props.height || 0, + width: props.width || 0, zoomCache: {} }; } diff --git a/client/app/scripts/charts/nodes-grid.js b/client/app/scripts/charts/nodes-grid.js index 8e791a3c6..a97e7a98d 100644 --- a/client/app/scripts/charts/nodes-grid.js +++ b/client/app/scripts/charts/nodes-grid.js @@ -121,7 +121,7 @@ class NodesGrid extends React.Component { return (