mirror of
https://github.com/FoggedLens/iD.git
synced 2026-05-15 21:48:20 +02:00
Disable Move and Rotate menu buttons for touch interaction for now (re: #7599)
This commit is contained in:
Vendored
+1
-1
@@ -13012,4 +13012,4 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -76,5 +76,7 @@ export function operationMove(context, selectedIDs) {
|
||||
operation.title = t('operations.move.title');
|
||||
operation.behavior = behaviorOperation(context).which(operation);
|
||||
|
||||
operation.mouseOnly = true;
|
||||
|
||||
return operation;
|
||||
}
|
||||
|
||||
@@ -76,5 +76,7 @@ export function operationRotate(context, selectedIDs) {
|
||||
operation.title = t('operations.rotate.title');
|
||||
operation.behavior = behaviorOperation(context).which(operation);
|
||||
|
||||
operation.mouseOnly = true;
|
||||
|
||||
return operation;
|
||||
}
|
||||
|
||||
+10
-5
@@ -28,13 +28,18 @@ export function uiEditMenu(context) {
|
||||
var _menuSideMargin = 10;
|
||||
|
||||
var editMenu = function(selection) {
|
||||
if (!_operations.length) return;
|
||||
|
||||
var isTouchMenu = _triggerType.includes('touch') || _triggerType.includes('pen');
|
||||
|
||||
var ops = _operations.filter(function(op) {
|
||||
return !isTouchMenu || !op.mouseOnly;
|
||||
});
|
||||
|
||||
if (!ops.length) return;
|
||||
|
||||
var offset = [0, 0];
|
||||
var viewport = context.surfaceRect();
|
||||
|
||||
var isTouchMenu = _triggerType.includes('touch') || _triggerType.includes('pen');
|
||||
|
||||
// Position the menu above the anchor for stylus and finger input
|
||||
// since the mapper's hand likely obscures the screen below the anchor
|
||||
var menuTop = isTouchMenu;
|
||||
@@ -48,7 +53,7 @@ export function uiEditMenu(context) {
|
||||
|
||||
offset[0] = menuLeft ? -1 * (_menuSideMargin + menuWidth) : _menuSideMargin;
|
||||
|
||||
var menuHeight = _verticalPadding * 2 + _operations.length * buttonHeight;
|
||||
var menuHeight = _verticalPadding * 2 + ops.length * buttonHeight;
|
||||
|
||||
|
||||
if (menuTop) {
|
||||
@@ -78,7 +83,7 @@ export function uiEditMenu(context) {
|
||||
.style('top', origin[1] + 'px');
|
||||
|
||||
var buttons = _menu.selectAll('.edit-menu-item')
|
||||
.data(_operations);
|
||||
.data(ops);
|
||||
|
||||
// enter
|
||||
var buttonsEnter = buttons.enter()
|
||||
|
||||
Reference in New Issue
Block a user