mirror of
https://github.com/FoggedLens/iD.git
synced 2026-05-14 05:12:13 +02:00
Flash operation annotation when tapping buttons with touch or stylus (re: #7699)
This commit is contained in:
@@ -11,25 +11,21 @@ export function behaviorOperation(context) {
|
||||
|
||||
d3_event.preventDefault();
|
||||
var disabled = _operation.disabled();
|
||||
var flash;
|
||||
|
||||
if (disabled) {
|
||||
flash = context.ui().flash
|
||||
context.ui().flash
|
||||
.duration(4000)
|
||||
.iconName('#iD-operation-' + _operation.id)
|
||||
.iconClass('operation disabled')
|
||||
.text(_operation.tooltip);
|
||||
|
||||
flash();
|
||||
.text(_operation.tooltip)();
|
||||
|
||||
} else {
|
||||
flash = context.ui().flash
|
||||
context.ui().flash
|
||||
.duration(2000)
|
||||
.iconName('#iD-operation-' + _operation.id)
|
||||
.iconClass('operation')
|
||||
.text(_operation.annotation() || _operation.title);
|
||||
.text(_operation.annotation() || _operation.title)();
|
||||
|
||||
flash();
|
||||
if (_operation.point) _operation.point(null);
|
||||
_operation();
|
||||
}
|
||||
|
||||
@@ -123,6 +123,15 @@ export function uiEditMenu(context) {
|
||||
.text(operation.tooltip)();
|
||||
}
|
||||
} else {
|
||||
if (lastPointerUpType === 'touch' ||
|
||||
lastPointerUpType === 'pen') {
|
||||
context.ui().flash
|
||||
.duration(2000)
|
||||
.iconName('#iD-operation-' + operation.id)
|
||||
.iconClass('operation')
|
||||
.text(operation.annotation() || operation.title)();
|
||||
}
|
||||
|
||||
operation();
|
||||
editMenu.close();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user