Move the edit menu logic to uiInit

Make context the first argument of operation objects
Add Paste operation to edit menu when opening the context menu on a blank area of the map (close #2508)
This commit is contained in:
Quincy Morgan
2020-05-14 15:49:35 -04:00
parent c939924f83
commit db9eed2434
32 changed files with 256 additions and 148 deletions
+1 -1
View File
@@ -65,7 +65,7 @@ export function validationDisconnectedWay() {
entityIds: [singleEntity.id],
onClick: function(context) {
var id = this.issue.entityIds[0];
var operation = operationDelete([id], context);
var operation = operationDelete(context, [id]);
if (!operation.disabled()) {
operation();
}
+2 -2
View File
@@ -107,12 +107,12 @@ export function validationMissingTag(context) {
var deleteOnClick;
var id = this.entityIds[0];
var operation = operationDelete([id], context);
var operation = operationDelete(context, [id]);
var disabledReasonID = operation.disabled();
if (!disabledReasonID) {
deleteOnClick = function(context) {
var id = this.issue.entityIds[0];
var operation = operationDelete([id], context);
var operation = operationDelete(context, [id]);
if (!operation.disabled()) {
operation();
}