mirror of
https://github.com/umap-project/umap.git
synced 2025-04-28 11:32:38 +02:00
commit
7b582a8ec1
3 changed files with 4 additions and 8 deletions
|
@ -218,6 +218,7 @@ class Feature {
|
|||
|
||||
edit(event) {
|
||||
if (!this._umap.editEnabled || this.isReadOnly()) return
|
||||
if (this._umap.editedFeature === this) return
|
||||
const container = DomUtil.create('div', 'umap-feature-container')
|
||||
DomUtil.createTitle(
|
||||
container,
|
||||
|
@ -326,7 +327,9 @@ class Feature {
|
|||
]
|
||||
}
|
||||
|
||||
endEdit() {}
|
||||
endEdit() {
|
||||
this.ui.disableEdit()
|
||||
}
|
||||
|
||||
getDisplayName() {
|
||||
const keys = U.LABEL_KEYS.slice() // Copy.
|
||||
|
@ -828,11 +831,6 @@ class Path extends Feature {
|
|||
)
|
||||
}
|
||||
|
||||
endEdit() {
|
||||
this.ui.disableEdit()
|
||||
super.endEdit()
|
||||
}
|
||||
|
||||
transferShape(at, to) {
|
||||
const shape = this.ui.enableEdit().deleteShapeAt(at)
|
||||
// FIXME: make Leaflet.Editable send an event instead
|
||||
|
|
|
@ -111,7 +111,6 @@ const PointMixin = {
|
|||
this.on('dragend', (event) => {
|
||||
this.isDirty = true
|
||||
this.feature.edit(event)
|
||||
// this.feature.pullGeometry(false)
|
||||
})
|
||||
if (!this.feature.isReadOnly()) this.on('mouseover', this._enableDragging)
|
||||
this.on('mouseout', this._onMouseOut)
|
||||
|
|
|
@ -525,7 +525,6 @@ export default class Umap {
|
|||
'Ctrl+e': {
|
||||
if: () => this.hasEditMode(),
|
||||
do: () => {
|
||||
console.log('doing')
|
||||
if (!this.editEnabled) this.enableEdit()
|
||||
else if (!this.isDirty) this.disableEdit()
|
||||
},
|
||||
|
|
Loading…
Reference in a new issue