mirror of
https://github.com/a-nyx/maputnik-with-pmtiles.git
synced 2025-03-26 09:10:26 +01:00
Absolute position to not take up space
This commit is contained in:
parent
df94d9c842
commit
9ca8760564
2 changed files with 5 additions and 8 deletions
src
|
@ -24,7 +24,6 @@ function layerPrefix(name) {
|
|||
}
|
||||
|
||||
function findClosestCommonPrefix(layers, idx) {
|
||||
console.log('find prefix', idx, layers)
|
||||
const currentLayerPrefix = layerPrefix(layers[idx].id)
|
||||
let closestIdx = idx
|
||||
for (let i = idx; i > 0; i--) {
|
||||
|
@ -118,14 +117,12 @@ class LayerListContainer extends React.Component {
|
|||
} else {
|
||||
newGroups[lookupKey] = true
|
||||
}
|
||||
console.log(newGroups)
|
||||
this.setState({
|
||||
collapsedGroups: newGroups
|
||||
})
|
||||
}
|
||||
|
||||
isCollapsed(groupPrefix, idx) {
|
||||
console.log('is collapsed', groupPrefix, idx)
|
||||
const collapsed = this.state.collapsedGroups[[groupPrefix, idx].join('-')]
|
||||
return collapsed === undefined ? false : collapsed
|
||||
}
|
||||
|
@ -151,7 +148,7 @@ class LayerListContainer extends React.Component {
|
|||
const listItem = <LayerListItem
|
||||
className={classnames({
|
||||
'maputnik-layer-list-item-collapsed': this.isCollapsed(groupPrefix, groupIdx),
|
||||
'maputnik-layer-list-item-collapsed-last': idxInGroup == layers.length - 1 && layers.length > 1
|
||||
'maputnik-layer-list-item-group-last': idxInGroup == layers.length - 1 && layers.length > 1
|
||||
})}
|
||||
index={idx}
|
||||
key={layer.id}
|
||||
|
|
|
@ -67,15 +67,15 @@
|
|||
}
|
||||
|
||||
&-item-collapsed {
|
||||
max-height: 0;
|
||||
position: absolute;
|
||||
max-height: 0px;
|
||||
overflow: hidden;
|
||||
padding: 0;
|
||||
|
||||
padding: 0px;
|
||||
transition: max-height 0.1s ease-out;
|
||||
transition: padding 0.1s ease-out;
|
||||
}
|
||||
|
||||
&-item-collapsed-last {
|
||||
&-item-group-last {
|
||||
border-bottom: 2px solid $color-gray;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue