From e5fbe3b74af7450b03ad7090667148a2a5263c78 Mon Sep 17 00:00:00 2001 From: Lukas Martinelli Date: Wed, 25 Jan 2017 13:34:10 +0100 Subject: [PATCH] Collapse layer groups by default #66 --- src/components/layers/LayerList.jsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/components/layers/LayerList.jsx b/src/components/layers/LayerList.jsx index e0739e2..00bf33e 100644 --- a/src/components/layers/LayerList.jsx +++ b/src/components/layers/LayerList.jsx @@ -115,7 +115,7 @@ class LayerListContainer extends React.Component { if(lookupKey in this.state.collapsedGroups) { newGroups[lookupKey] = !this.state.collapsedGroups[lookupKey] } else { - newGroups[lookupKey] = true + newGroups[lookupKey] = false } this.setState({ collapsedGroups: newGroups @@ -124,7 +124,7 @@ class LayerListContainer extends React.Component { isCollapsed(groupPrefix, idx) { const collapsed = this.state.collapsedGroups[[groupPrefix, idx].join('-')] - return collapsed === undefined ? false : collapsed + return collapsed === undefined ? true : collapsed } render() { @@ -147,7 +147,7 @@ class LayerListContainer extends React.Component { const groupIdx = findClosestCommonPrefix(this.props.layers, idx) const listItem = 1 && this.isCollapsed(groupPrefix, groupIdx), 'maputnik-layer-list-item-group-last': idxInGroup == layers.length - 1 && layers.length > 1 })} index={idx}