mirror of
https://github.com/a-nyx/maputnik-with-pmtiles.git
synced 2024-12-29 07:50:28 +01:00
Add helper class and style the helper
This commit is contained in:
parent
59ad91fdf8
commit
a74eb2989c
2 changed files with 11 additions and 3 deletions
|
@ -46,7 +46,7 @@ class LayerListContainer extends React.Component {
|
||||||
areAllGroupsExpanded: false,
|
areAllGroupsExpanded: false,
|
||||||
isOpen: {
|
isOpen: {
|
||||||
add: false,
|
add: false,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
toggleModal(modalName) {
|
toggleModal(modalName) {
|
||||||
|
@ -66,12 +66,12 @@ class LayerListContainer extends React.Component {
|
||||||
this.groupedLayers().forEach(layers => {
|
this.groupedLayers().forEach(layers => {
|
||||||
const groupPrefix = layerPrefix(layers[0].id)
|
const groupPrefix = layerPrefix(layers[0].id)
|
||||||
const lookupKey = [groupPrefix, idx].join('-')
|
const lookupKey = [groupPrefix, idx].join('-')
|
||||||
|
|
||||||
|
|
||||||
if (layers.length > 1) {
|
if (layers.length > 1) {
|
||||||
newGroups[lookupKey] = this.state.areAllGroupsExpanded
|
newGroups[lookupKey] = this.state.areAllGroupsExpanded
|
||||||
}
|
}
|
||||||
|
|
||||||
layers.forEach((layer) => {
|
layers.forEach((layer) => {
|
||||||
idx += 1
|
idx += 1
|
||||||
})
|
})
|
||||||
|
@ -204,6 +204,7 @@ export default class LayerList extends React.Component {
|
||||||
render() {
|
render() {
|
||||||
return <LayerListContainerSortable
|
return <LayerListContainerSortable
|
||||||
{...this.props}
|
{...this.props}
|
||||||
|
helperClass='sortableHelper'
|
||||||
onSortEnd={this.props.onMoveLayer.bind(this)}
|
onSortEnd={this.props.onMoveLayer.bind(this)}
|
||||||
useDragHandle={true}
|
useDragHandle={true}
|
||||||
/>
|
/>
|
||||||
|
|
|
@ -234,3 +234,10 @@
|
||||||
min-width: 28px;
|
min-width: 28px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Clone of the element which is sorted
|
||||||
|
.sortableHelper {
|
||||||
|
font-family: $font-family;
|
||||||
|
z-index: 9999;
|
||||||
|
border: none;
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in a new issue