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