Flash operation annotation when tapping buttons with touch or stylus (re: #7699)

This commit is contained in:
Quincy Morgan
2020-06-25 11:21:23 -04:00
parent d1f9cae357
commit d441c5b0c6
2 changed files with 13 additions and 8 deletions
+4 -8
View File
@@ -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();
}
+9
View File
@@ -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();
}