mirror of
https://github.com/FoggedLens/iD.git
synced 2026-05-19 23:14:47 +02:00
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:
@@ -6,7 +6,7 @@ import { geoExtent, geoPointInPolygon, geoVecSubtract } from '../geo';
|
||||
import { modeMove } from '../modes/move';
|
||||
import { uiCmd } from '../ui/cmd';
|
||||
|
||||
|
||||
// see also `operationPaste`
|
||||
export function behaviorPaste(context) {
|
||||
|
||||
function doPaste() {
|
||||
@@ -22,13 +22,13 @@ export function behaviorPaste(context) {
|
||||
|
||||
if (!geoPointInPolygon(mouse, viewport)) return;
|
||||
|
||||
var extent = geoExtent();
|
||||
var oldIDs = context.copyIDs();
|
||||
if (!oldIDs.length) return;
|
||||
|
||||
var extent = geoExtent();
|
||||
var oldGraph = context.copyGraph();
|
||||
var newIDs = [];
|
||||
|
||||
if (!oldIDs.length) return;
|
||||
|
||||
var action = actionCopyEntities(oldIDs, oldGraph);
|
||||
context.perform(action);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user