Don't show radial menu after dragging node (fixes #1385)

This commit is contained in:
John Firebaugh
2013-04-26 11:45:01 -07:00
parent e5dd800aff
commit 24ecf2a697
4 changed files with 20 additions and 5 deletions
+4 -1
View File
@@ -174,7 +174,10 @@ iD.behavior.DrawWay = function(context, wayId, index, mode, baseGraph) {
}, 1000);
if (context.hasEntity(wayId)) {
context.enter(iD.modes.Select(context, [wayId]).newFeature(true));
context.enter(
iD.modes.Select(context, [wayId])
.suppressMenu(true)
.newFeature(true));
} else {
context.enter(iD.modes.Browse(context));
}
+4 -1
View File
@@ -20,7 +20,10 @@ iD.modes.AddPoint = function(context) {
iD.actions.AddEntity(node),
t('operations.add.annotation.point'));
context.enter(iD.modes.Select(context, [node.id]).newFeature(true));
context.enter(
iD.modes.Select(context, [node.id])
.suppressMenu(true)
.newFeature(true));
}
function addWay(loc, edge) {
+3 -1
View File
@@ -138,7 +138,9 @@ iD.modes.DragNode = function(context) {
var parentWays = _.pluck(context.graph().parentWays(entity), 'id');
context.enter(iD.modes.Select(context, parentWays));
context.enter(
iD.modes.Select(context, parentWays)
.suppressMenu(true));
}
function cancel() {
+9 -2
View File
@@ -13,7 +13,8 @@ iD.modes.Select = function(context, selection) {
iD.modes.DragNode(context).behavior],
inspector,
radialMenu,
newFeature = false;
newFeature = false,
suppressMenu = false;
var wrap = context.container()
.select('.inspector-wrap');
@@ -60,6 +61,12 @@ iD.modes.Select = function(context, selection) {
return mode;
};
mode.suppressMenu = function(_) {
if (!arguments.length) return suppressMenu;
suppressMenu = _;
return mode;
};
mode.enter = function() {
behaviors.forEach(function(behavior) {
context.install(behavior);
@@ -162,7 +169,7 @@ iD.modes.Select = function(context, selection) {
selectElements();
radialMenu = iD.ui.RadialMenu(operations);
var show = d3.event && !newFeature;
var show = d3.event && !suppressMenu;
if (show) {
positionMenu();