mirror of
https://github.com/FoggedLens/iD.git
synced 2026-05-19 23:14:47 +02:00
Remove global selection from walkthrough (re: #7445)
This commit is contained in:
@@ -339,7 +339,7 @@ export function uiIntroBuilding(context, reveal) {
|
||||
if (ids.length !== 1 || ids[0] !== _houseID) return;
|
||||
|
||||
timeout(function() {
|
||||
var node = selectMenuItem('orthogonalize').node();
|
||||
var node = selectMenuItem(context, 'orthogonalize').node();
|
||||
if (!node) return;
|
||||
continueTo(clickSquare);
|
||||
}, 300); // after menu visible
|
||||
@@ -367,7 +367,7 @@ export function uiIntroBuilding(context, reveal) {
|
||||
var entity = context.hasEntity(_houseID);
|
||||
if (!entity) return continueTo(rightClickHouse);
|
||||
|
||||
var node = selectMenuItem('orthogonalize').node();
|
||||
var node = selectMenuItem(context, 'orthogonalize').node();
|
||||
if (!node) { return continueTo(rightClickHouse); }
|
||||
|
||||
var wasChanged = false;
|
||||
@@ -386,7 +386,7 @@ export function uiIntroBuilding(context, reveal) {
|
||||
});
|
||||
|
||||
context.map().on('move.intro drawn.intro', function() {
|
||||
var node = selectMenuItem('orthogonalize').node();
|
||||
var node = selectMenuItem(context, 'orthogonalize').node();
|
||||
if (!wasChanged && !node) { return continueTo(rightClickHouse); }
|
||||
|
||||
revealEditMenu(menuCoords,
|
||||
@@ -657,7 +657,7 @@ export function uiIntroBuilding(context, reveal) {
|
||||
if (ids.length !== 1 || ids[0] !== _tankID) return;
|
||||
|
||||
timeout(function() {
|
||||
var node = selectMenuItem('circularize').node();
|
||||
var node = selectMenuItem(context, 'circularize').node();
|
||||
if (!node) return;
|
||||
continueTo(clickCircle);
|
||||
}, 300); // after menu visible
|
||||
@@ -689,7 +689,7 @@ export function uiIntroBuilding(context, reveal) {
|
||||
var entity = context.hasEntity(_tankID);
|
||||
if (!entity) return continueTo(rightClickTank);
|
||||
|
||||
var node = selectMenuItem('circularize').node();
|
||||
var node = selectMenuItem(context, 'circularize').node();
|
||||
if (!node) { return continueTo(rightClickTank); }
|
||||
|
||||
var wasChanged = false;
|
||||
@@ -708,7 +708,7 @@ export function uiIntroBuilding(context, reveal) {
|
||||
});
|
||||
|
||||
context.map().on('move.intro drawn.intro', function() {
|
||||
var node = selectMenuItem('circularize').node();
|
||||
var node = selectMenuItem(context, 'circularize').node();
|
||||
if (!wasChanged && !node) { return continueTo(rightClickTank); }
|
||||
|
||||
revealEditMenu(menuCoords,
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
import { select as d3_select } from 'd3-selection';
|
||||
|
||||
import { t } from '../../util/locale';
|
||||
import { geoSphericalDistance, geoVecNormalizedDot } from '../../geo';
|
||||
|
||||
@@ -134,8 +132,8 @@ export function isMostlySquare(points) {
|
||||
}
|
||||
|
||||
|
||||
export function selectMenuItem(operation) {
|
||||
return d3_select('.edit-menu .edit-menu-item-' + operation);
|
||||
export function selectMenuItem(context, operation) {
|
||||
return context.container().select('.edit-menu .edit-menu-item-' + operation);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
import { select as d3_select } from 'd3-selection';
|
||||
|
||||
import { t, textDirection } from '../../util/locale';
|
||||
import { localize } from './helper';
|
||||
|
||||
@@ -132,7 +130,7 @@ export function uiIntro(context) {
|
||||
|
||||
if (i < chapterFlow.length - 1) {
|
||||
const next = chapterFlow[i + 1];
|
||||
d3_select(`button.chapter-${next}`)
|
||||
context.container().select(`button.chapter-${next}`)
|
||||
.classed('next', true);
|
||||
}
|
||||
|
||||
|
||||
@@ -672,7 +672,7 @@ export function uiIntroLine(context, reveal) {
|
||||
if (ids.length !== 1 || ids[0] !== eleventhAvenueEndID) return;
|
||||
|
||||
timeout(function() {
|
||||
var node = selectMenuItem('split').node();
|
||||
var node = selectMenuItem(context, 'split').node();
|
||||
if (!node) return;
|
||||
continueTo(splitIntersection);
|
||||
}, 300); // after menu visible
|
||||
@@ -702,7 +702,7 @@ export function uiIntroLine(context, reveal) {
|
||||
return continueTo(deleteLines);
|
||||
}
|
||||
|
||||
var node = selectMenuItem('split').node();
|
||||
var node = selectMenuItem(context, 'split').node();
|
||||
if (!node) { return continueTo(rightClickIntersection); }
|
||||
|
||||
var wasChanged = false;
|
||||
@@ -714,7 +714,7 @@ export function uiIntroLine(context, reveal) {
|
||||
);
|
||||
|
||||
context.map().on('move.intro drawn.intro', function() {
|
||||
var node = selectMenuItem('split').node();
|
||||
var node = selectMenuItem(context, 'split').node();
|
||||
if (!wasChanged && !node) { return continueTo(rightClickIntersection); }
|
||||
|
||||
revealEditMenu(menuCoords, t('intro.lines.split_intersection',
|
||||
@@ -940,7 +940,7 @@ export function uiIntroLine(context, reveal) {
|
||||
if (ids.length === 2 &&
|
||||
ids.indexOf(twelfthAvenueID) !== -1 &&
|
||||
ids.indexOf(_washingtonSegmentID) !== -1) {
|
||||
var node = selectMenuItem('delete').node();
|
||||
var node = selectMenuItem(context, 'delete').node();
|
||||
if (!node) return;
|
||||
continueTo(multiDelete);
|
||||
} else if (ids.length === 1 &&
|
||||
@@ -980,7 +980,7 @@ export function uiIntroLine(context, reveal) {
|
||||
return continueTo(rightClickIntersection);
|
||||
}
|
||||
|
||||
var node = selectMenuItem('delete').node();
|
||||
var node = selectMenuItem(context, 'delete').node();
|
||||
if (!node) return continueTo(multiRightClick);
|
||||
|
||||
var menuCoords = context.map().mouseCoordinates();
|
||||
|
||||
@@ -401,7 +401,7 @@ export function uiIntroPoint(context, reveal) {
|
||||
if (ids.length !== 1 || ids[0] !== _pointID) return;
|
||||
|
||||
timeout(function() {
|
||||
var node = selectMenuItem('delete').node();
|
||||
var node = selectMenuItem(context, 'delete').node();
|
||||
if (!node) return;
|
||||
continueTo(enterDelete);
|
||||
}, 300); // after menu visible
|
||||
@@ -420,7 +420,7 @@ export function uiIntroPoint(context, reveal) {
|
||||
var entity = context.hasEntity(_pointID);
|
||||
if (!entity) return chapter.restart();
|
||||
|
||||
var node = selectMenuItem('delete').node();
|
||||
var node = selectMenuItem(context, 'delete').node();
|
||||
if (!node) { return continueTo(rightClickPoint); }
|
||||
|
||||
revealEditMenu(entity.loc,
|
||||
|
||||
Reference in New Issue
Block a user