mirror of
https://github.com/a-nyx/maputnik-with-pmtiles.git
synced 2025-01-28 23:20:26 +01:00
Collapse layer groups by default #66
This commit is contained in:
parent
3f262885ca
commit
e5fbe3b74a
1 changed files with 3 additions and 3 deletions
|
@ -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 = <LayerListItem
|
||||
className={classnames({
|
||||
'maputnik-layer-list-item-collapsed': this.isCollapsed(groupPrefix, groupIdx),
|
||||
'maputnik-layer-list-item-collapsed': layers.length > 1 && this.isCollapsed(groupPrefix, groupIdx),
|
||||
'maputnik-layer-list-item-group-last': idxInGroup == layers.length - 1 && layers.length > 1
|
||||
})}
|
||||
index={idx}
|
||||
|
|
Loading…
Reference in a new issue