mirror of
https://github.com/maputnik/editor.git
synced 2026-07-12 00:47:35 +00:00
Added a visible drag handle.
This commit is contained in:
@@ -2,7 +2,7 @@ import React from 'react'
|
|||||||
import PropTypes from 'prop-types'
|
import PropTypes from 'prop-types'
|
||||||
import classnames from 'classnames'
|
import classnames from 'classnames'
|
||||||
|
|
||||||
import {MdContentCopy, MdVisibility, MdVisibilityOff, MdDelete} from 'react-icons/md'
|
import {MdMenu, MdContentCopy, MdVisibility, MdVisibilityOff, MdDelete} from 'react-icons/md'
|
||||||
|
|
||||||
import LayerIcon from '../icons/LayerIcon'
|
import LayerIcon from '../icons/LayerIcon'
|
||||||
import {SortableElement, SortableHandle} from 'react-sortable-hoc'
|
import {SortableElement, SortableHandle} from 'react-sortable-hoc'
|
||||||
@@ -11,15 +11,15 @@ class LayerTypeDragHandle extends React.Component {
|
|||||||
static propTypes = LayerIcon.propTypes
|
static propTypes = LayerIcon.propTypes
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
return <LayerIcon
|
return <div className="layer-handle">
|
||||||
{...this.props}
|
<div className="layer-handle__handle">
|
||||||
style={{
|
<MdMenu style={{marginRight: "5px"}} />
|
||||||
cursor: 'move',
|
</div>
|
||||||
width: 14,
|
<LayerIcon
|
||||||
height: 14,
|
className="layer-handle__icon"
|
||||||
paddingRight: 3,
|
{...this.props}
|
||||||
}}
|
/>
|
||||||
/>
|
</div>
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -42,6 +42,8 @@
|
|||||||
opacity: 1;
|
opacity: 1;
|
||||||
-webkit-transition: opacity 600ms, visibility 600ms;
|
-webkit-transition: opacity 600ms, visibility 600ms;
|
||||||
transition: opacity 600ms, visibility 600ms;
|
transition: opacity 600ms, visibility 600ms;
|
||||||
|
padding-left: 0;
|
||||||
|
margin-left: -4px;
|
||||||
|
|
||||||
@media screen and (prefers-reduced-motion: reduce) {
|
@media screen and (prefers-reduced-motion: reduce) {
|
||||||
transition-duration: 0;
|
transition-duration: 0;
|
||||||
@@ -111,6 +113,8 @@
|
|||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
text-overflow: ellipsis;
|
text-overflow: ellipsis;
|
||||||
|
color: inherit;
|
||||||
|
text-decoration: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
&-group-header {
|
&-group-header {
|
||||||
@@ -229,3 +233,30 @@
|
|||||||
min-width: 28px;
|
min-width: 28px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.layer-handle {
|
||||||
|
width: 35px;
|
||||||
|
flex-shrink: 0;
|
||||||
|
cursor: move;
|
||||||
|
|
||||||
|
&__handle {
|
||||||
|
margin-right: 4px;
|
||||||
|
display: inline-block;
|
||||||
|
width: 14px;
|
||||||
|
height: 14px;
|
||||||
|
|
||||||
|
:not(:hover) {
|
||||||
|
path {
|
||||||
|
fill: #555;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
&__icon {
|
||||||
|
padding-right: 3px;
|
||||||
|
display: inline-block;
|
||||||
|
width: 14px;
|
||||||
|
height: 14px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user