mirror of
https://github.com/FoggedLens/iD.git
synced 2026-05-20 15:34:49 +02:00
Fixed an bug where the wrong feature could be deleted from the untagged feature issue fix
This commit is contained in:
@@ -104,7 +104,7 @@ export function uiEntityIssues(context) {
|
||||
.text(function(d) {
|
||||
return d.title;
|
||||
})
|
||||
.on('click', function(d){
|
||||
.on('click', function(d) {
|
||||
d.action()
|
||||
});
|
||||
}
|
||||
|
||||
@@ -42,7 +42,8 @@ export function validationMissingTag(context) {
|
||||
new validationIssueFix({
|
||||
title: t('issues.fix.delete_feature.title'),
|
||||
action: function() {
|
||||
operationDelete([change.id], context)();
|
||||
var id = this.issue.entities[0].id;
|
||||
operationDelete([id], context)();
|
||||
}
|
||||
}),
|
||||
new validationIssueFix({
|
||||
|
||||
@@ -44,6 +44,13 @@ export function validationIssue(attrs) {
|
||||
this.entities = attrs.entities; // expect an array of entities
|
||||
this.coordinates = attrs.coordinates; // expect a [lon, lat] array
|
||||
this.fixes = attrs.fixes; // expect an array of functions for possible fixes
|
||||
|
||||
if (this.fixes) {
|
||||
for (var i=0; i<this.fixes.length; i++) {
|
||||
// add a reference in the fix to the issue for use in fix actions
|
||||
this.fixes[i].issue = this;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export function validationIssueFix(attrs) {
|
||||
@@ -51,4 +58,6 @@ export function validationIssueFix(attrs) {
|
||||
this.title = attrs.title;
|
||||
this.action = attrs.action;
|
||||
|
||||
// the issue this fix is for
|
||||
this.issue = null;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user