mirror of
https://github.com/FoggedLens/iD.git
synced 2026-06-04 22:18:06 +02:00
suppressMenu(true) is now the default
This commit is contained in:
@@ -23,8 +23,8 @@ export function behaviorSelect(context) {
|
||||
|
||||
|
||||
function click() {
|
||||
var rtClick = d3.event.type === 'contextmenu';
|
||||
|
||||
var rtClick = d3.event.type === 'contextmenu';
|
||||
|
||||
if (rtClick) {
|
||||
d3.event.preventDefault();
|
||||
}
|
||||
@@ -40,21 +40,21 @@ export function behaviorSelect(context) {
|
||||
context.enter(modeBrowse(context));
|
||||
|
||||
} else if (!d3.event.shiftKey && !lasso) {
|
||||
// Reselect when 'rtClick on one of the selectedIDs'
|
||||
// Reselect when 'rtClick on one of the selectedIDs'
|
||||
// OR 'leftClick on the same singular selected entity'
|
||||
// Explanation: leftClick should discard any multiple
|
||||
// selection of entities and make the selection singlular.
|
||||
// Whereas rtClick should preserve multiple selection of
|
||||
// Whereas rtClick should preserve multiple selection of
|
||||
// entities if and only if it clicks on one of the selectedIDs.
|
||||
if (context.selectedIDs().indexOf(datum.id) >= 0
|
||||
&& (rtClick || context.selectedIDs().length === 1)) {
|
||||
if (context.selectedIDs().indexOf(datum.id) >= 0 &&
|
||||
(rtClick || context.selectedIDs().length === 1)) {
|
||||
mode.suppressMenu(false).reselect();
|
||||
} else {
|
||||
context.enter(modeSelect(context, [datum.id]));
|
||||
}
|
||||
} else if (context.selectedIDs().indexOf(datum.id) >= 0) {
|
||||
if (rtClick) { // To prevent datum.id from being removed when rtClick
|
||||
mode.suppressMenu(false).reselect();
|
||||
mode.suppressMenu(false).reselect();
|
||||
} else {
|
||||
var selectedIDs = _.without(context.selectedIDs(), datum.id);
|
||||
context.enter(selectedIDs.length ? modeSelect(context, selectedIDs) : modeBrowse(context));
|
||||
|
||||
Reference in New Issue
Block a user