From dc2318ab634806f3d5c829152bd58230edf2514d Mon Sep 17 00:00:00 2001 From: Bryan Housel Date: Wed, 22 Feb 2017 17:31:08 -0500 Subject: [PATCH] Add mention of the right-click menu in the walkthrough --- data/core.yaml | 4 ++-- dist/locales/en.json | 4 ++-- modules/behavior/select.js | 1 + modules/ui/intro/point.js | 14 +++++++++----- 4 files changed, 14 insertions(+), 9 deletions(-) diff --git a/data/core.yaml b/data/core.yaml index 7373e5a16..5fb4a04de 100644 --- a/data/core.yaml +++ b/data/core.yaml @@ -814,8 +814,8 @@ en: close: "The feature editor will remember all of your changes automatically. When you change a feature, the close button will change to a checkmark. **Click the {button} button to close the feature editor**" reselect: "Often points will already exist, but have mistakes or be incomplete. We can edit existing points. **Click to select the point you just created.**" fixname: "**Change the name, then click the {button} button to close the feature editor.**" - reselect_delete: "All features on the map can be deleted. **Click to select the point you created.**" - delete: "The menu around the point contains operations that can be performed on it, including delete. **Click on the {button} button to delete the point.**" + rightclick: "You can right-click on features to see the list of operations that can be performed on them. **Right-click to select the point you created.**" + delete: "**Click on the {button} button to delete the point.**" areas: title: "Areas" add: "Areas are used to show the boundaries of features like lakes, buildings, and residential areas. They can be also be used for more detailed mapping of many features you might normally map as points. **Click the {button} Area button to add a new area.**" diff --git a/dist/locales/en.json b/dist/locales/en.json index d4f072c16..67c43b4b7 100644 --- a/dist/locales/en.json +++ b/dist/locales/en.json @@ -669,8 +669,8 @@ "close": "The feature editor will remember all of your changes automatically. When you change a feature, the close button will change to a checkmark. **Click the {button} button to close the feature editor**", "reselect": "Often points will already exist, but have mistakes or be incomplete. We can edit existing points. **Click to select the point you just created.**", "fixname": "**Change the name, then click the {button} button to close the feature editor.**", - "reselect_delete": "All features on the map can be deleted. **Click to select the point you created.**", - "delete": "The menu around the point contains operations that can be performed on it, including delete. **Click on the {button} button to delete the point.**" + "rightclick": "You can right-click on features to see the list of operations that can be performed on them. **Right-click to select the point you created.**", + "delete": "**Click on the {button} button to delete the point.**" }, "areas": { "title": "Areas", diff --git a/modules/behavior/select.js b/modules/behavior/select.js index 59273d144..8d9727c33 100644 --- a/modules/behavior/select.js +++ b/modules/behavior/select.js @@ -35,6 +35,7 @@ export function behaviorSelect(context) { function contextmenu() { if (!p1) p1 = point(); d3.event.preventDefault(); + context.surface().node().focus(); suppressMenu = false; click(); } diff --git a/modules/ui/intro/point.js b/modules/ui/intro/point.js index 14b8e235d..54bf08c70 100644 --- a/modules/ui/intro/point.js +++ b/modules/ui/intro/point.js @@ -125,11 +125,11 @@ export function uiIntroPoint(context, reveal) { context.on('enter.intro', enterDelete); var pointBox = pad(corner, 150, context); - reveal(pointBox, t('intro.points.reselect_delete')); + reveal(pointBox, t('intro.points.rightclick')); context.map().on('move.intro', function() { pointBox = pad(corner, 150, context); - reveal(pointBox, t('intro.points.reselect_delete'), {duration: 0}); + reveal(pointBox, t('intro.points.rightclick'), {duration: 0}); }); } @@ -145,9 +145,13 @@ export function uiIntroPoint(context, reveal) { setTimeout(function() { // deprecation warning - Radial Menu to be removed in iD v3 var node = d3.select('.edit-menu-item-delete, .radial-menu-item-delete').node(); - var pointBox = pad(node.getBoundingClientRect(), 50, context); - reveal(pointBox, - t('intro.points.delete', { button: icon('#operation-delete', 'pre-text') })); + if (!node) { + deletePoint(); + } else { + var pointBox = pad(node.getBoundingClientRect(), 50, context); + reveal(pointBox, + t('intro.points.delete', { button: icon('#operation-delete', 'pre-text') })); + } }, 300); }