mirror of
https://github.com/maputnik/editor.git
synced 2026-07-27 00:07:25 +00:00
Added additional menu in <LayerEditor/>
This is to make the following options accessible to keyboard users - reorder layers - duplicate layer - delete layer - hide/show layer
This commit is contained in:
@@ -38,7 +38,7 @@ class IconAction extends React.Component {
|
||||
|
||||
renderIcon() {
|
||||
switch(this.props.action) {
|
||||
case 'copy': return <CopyIcon />
|
||||
case 'duplicate': return <CopyIcon />
|
||||
case 'show': return <VisibilityIcon />
|
||||
case 'hide': return <VisibilityOffIcon />
|
||||
case 'delete': return <DeleteIcon />
|
||||
@@ -46,13 +46,15 @@ class IconAction extends React.Component {
|
||||
}
|
||||
|
||||
render() {
|
||||
return <a
|
||||
return <button
|
||||
tabIndex="-1"
|
||||
title={this.props.action}
|
||||
className="maputnik-layer-list-icon-action"
|
||||
data-wd-key={this.props.wdKey}
|
||||
onClick={this.props.onClick}
|
||||
>
|
||||
{this.renderIcon()}
|
||||
</a>
|
||||
</button>
|
||||
}
|
||||
}
|
||||
|
||||
@@ -109,7 +111,7 @@ class LayerListItem extends React.Component {
|
||||
/>
|
||||
<IconAction
|
||||
wdKey={"layer-list-item:"+this.props.layerId+":copy"}
|
||||
action={'copy'}
|
||||
action={'duplicate'}
|
||||
onClick={e => this.props.onLayerCopy(this.props.layerId)}
|
||||
/>
|
||||
<IconAction
|
||||
|
||||
Reference in New Issue
Block a user